@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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useUser, useMe, useConversations, useUserPresence, formatCallLogPreview, useAttachmentUpload, usePoolse, useConversation, useMembers, usePresence, receiptsOf, useMessages, useTyping, useMessageStreams, useRealtimeStatus, isMessageVisibleTo, computeGroupPosition, canEditOwnMessage, isTombstone, formatDayLabel, callLogDisplayFor, useLiveCall, sameDay, useReactions, useThread, useAttachmentUrl } from '@poolse/react';
|
|
1
|
+
import { useUser, useMe, useConversations, useUserPresence, formatCallLogPreview, useAttachmentUpload, usePoolse, filterConversations, useConversation, useMembers, usePresence, receiptsOf, useMessages, useTyping, useMessageStreams, useRealtimeStatus, isMessageVisibleTo, computeGroupPosition, canEditOwnMessage, isTombstone, formatDayLabel, callLogDisplayFor, useLiveCall, sameDay, useReactions, useThread, useAttachmentUrl } from '@poolse/react';
|
|
2
2
|
import { createContext, forwardRef, useRef, useState, useImperativeHandle, useEffect, useMemo, useCallback, useContext, createElement } from 'react';
|
|
3
3
|
import { StyleSheet, View, Pressable, TextInput, Text, useWindowDimensions, Animated, Easing, PanResponder, Keyboard, Platform, ScrollView, Modal, AppState, ActivityIndicator, SectionList, FlatList, KeyboardAvoidingView, Image, Linking, useColorScheme } from 'react-native';
|
|
4
4
|
import { SvgXml, Svg, Path, Circle, G } from 'react-native-svg';
|
|
@@ -6,6 +6,7 @@ import { toNativeTheme, isBuiltInThemeId } from '@poolse/theme';
|
|
|
6
6
|
export { BUILT_IN_THEME_IDS, DEFAULT_THEME_ID, createTheme, decodeTheme, encodeTheme, tokensFromFlat } from '@poolse/theme';
|
|
7
7
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
|
+
import { safeUuid, MessageQueuedError } from '@poolse/sdk';
|
|
9
10
|
import * as ImagePicker from 'expo-image-picker';
|
|
10
11
|
import * as DocumentPicker from 'expo-document-picker';
|
|
11
12
|
import { manipulateAsync, SaveFormat } from 'expo-image-manipulator';
|
|
@@ -1295,7 +1296,17 @@ function ChatHeader({
|
|
|
1295
1296
|
}
|
|
1296
1297
|
],
|
|
1297
1298
|
children: [
|
|
1298
|
-
onBack ? /* @__PURE__ */ jsx(
|
|
1299
|
+
onBack ? /* @__PURE__ */ jsx(
|
|
1300
|
+
Pressable,
|
|
1301
|
+
{
|
|
1302
|
+
onPress: onBack,
|
|
1303
|
+
hitSlop: 12,
|
|
1304
|
+
style: styles5.backBtn,
|
|
1305
|
+
accessibilityRole: "button",
|
|
1306
|
+
accessibilityLabel: "Back",
|
|
1307
|
+
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "reply", size: 20, color: theme.colors.text })
|
|
1308
|
+
}
|
|
1309
|
+
) : null,
|
|
1299
1310
|
/* @__PURE__ */ jsx(
|
|
1300
1311
|
Avatar,
|
|
1301
1312
|
{
|
|
@@ -1326,6 +1337,7 @@ function ChatHeader({
|
|
|
1326
1337
|
onPress: onMembersPress,
|
|
1327
1338
|
hitSlop: 12,
|
|
1328
1339
|
style: styles5.actionBtn,
|
|
1340
|
+
accessibilityRole: "button",
|
|
1329
1341
|
accessibilityLabel: "Show members",
|
|
1330
1342
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "users", size: 20, color: theme.colors.textMuted })
|
|
1331
1343
|
}
|
|
@@ -1381,6 +1393,34 @@ var styles5 = StyleSheet.create({
|
|
|
1381
1393
|
marginLeft: -6
|
|
1382
1394
|
}
|
|
1383
1395
|
});
|
|
1396
|
+
function EmptyState({ title, hint, action }) {
|
|
1397
|
+
const theme = useTheme();
|
|
1398
|
+
return /* @__PURE__ */ jsxs(View, { style: styles6.root, accessible: true, accessibilityRole: "text", children: [
|
|
1399
|
+
/* @__PURE__ */ jsx(
|
|
1400
|
+
Text,
|
|
1401
|
+
{
|
|
1402
|
+
style: [styles6.title, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
1403
|
+
maxFontSizeMultiplier: 2,
|
|
1404
|
+
children: title
|
|
1405
|
+
}
|
|
1406
|
+
),
|
|
1407
|
+
hint ? /* @__PURE__ */ jsx(
|
|
1408
|
+
Text,
|
|
1409
|
+
{
|
|
1410
|
+
style: [styles6.hint, { color: theme.colors.textMuted, fontFamily: theme.fonts.body }],
|
|
1411
|
+
maxFontSizeMultiplier: 2,
|
|
1412
|
+
children: hint
|
|
1413
|
+
}
|
|
1414
|
+
) : null,
|
|
1415
|
+
action ? /* @__PURE__ */ jsx(View, { style: styles6.action, children: action }) : null
|
|
1416
|
+
] });
|
|
1417
|
+
}
|
|
1418
|
+
var styles6 = StyleSheet.create({
|
|
1419
|
+
root: { alignItems: "center", paddingHorizontal: 24, paddingVertical: 24, maxWidth: 360 },
|
|
1420
|
+
title: { fontSize: 16, fontWeight: "600", textAlign: "center" },
|
|
1421
|
+
hint: { fontSize: 14, lineHeight: 20, marginTop: 6, textAlign: "center" },
|
|
1422
|
+
action: { marginTop: 14 }
|
|
1423
|
+
});
|
|
1384
1424
|
|
|
1385
1425
|
// src/internal/conversationSections.ts
|
|
1386
1426
|
var TYPE_SECTIONS = [
|
|
@@ -1402,6 +1442,8 @@ function ConversationList({
|
|
|
1402
1442
|
onSelect,
|
|
1403
1443
|
renderItem,
|
|
1404
1444
|
emptyState,
|
|
1445
|
+
query = "",
|
|
1446
|
+
noResultsState,
|
|
1405
1447
|
conversations: controlled,
|
|
1406
1448
|
loading: controlledLoading,
|
|
1407
1449
|
error: controlledError,
|
|
@@ -1423,7 +1465,15 @@ function ConversationList({
|
|
|
1423
1465
|
const meExternalId = me?.external_id ?? null;
|
|
1424
1466
|
const meId = me?.id ?? null;
|
|
1425
1467
|
const isControlled = controlled !== void 0;
|
|
1426
|
-
const
|
|
1468
|
+
const allConversations = isControlled ? controlled : auto.conversations;
|
|
1469
|
+
const needle = query.trim();
|
|
1470
|
+
const conversations = useMemo(
|
|
1471
|
+
() => needle ? filterConversations(allConversations, needle, {
|
|
1472
|
+
meExternalId,
|
|
1473
|
+
...labelFor ? { labelFor } : {}
|
|
1474
|
+
}) : allConversations,
|
|
1475
|
+
[allConversations, needle, meExternalId, labelFor]
|
|
1476
|
+
);
|
|
1427
1477
|
const loading = isControlled ? controlledLoading ?? false : auto.loading;
|
|
1428
1478
|
const error = isControlled ? controlledError ?? null : auto.error;
|
|
1429
1479
|
const counts = unreadCounts ?? (isControlled ? void 0 : auto.unreadCounts);
|
|
@@ -1472,9 +1522,9 @@ function ConversationList({
|
|
|
1472
1522
|
onSelect
|
|
1473
1523
|
]
|
|
1474
1524
|
);
|
|
1475
|
-
const placeholder = (node) => /* @__PURE__ */ jsxs(View, { style: [
|
|
1525
|
+
const placeholder = (node) => /* @__PURE__ */ jsxs(View, { style: [styles7.flex, { backgroundColor: theme.colors.background }], children: [
|
|
1476
1526
|
header,
|
|
1477
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
1527
|
+
/* @__PURE__ */ jsx(View, { style: styles7.placeholder, children: node })
|
|
1478
1528
|
] });
|
|
1479
1529
|
if (loading && conversations.length === 0) {
|
|
1480
1530
|
return placeholder(/* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.accent }));
|
|
@@ -1484,12 +1534,29 @@ function ConversationList({
|
|
|
1484
1534
|
/* @__PURE__ */ jsx(Text, { style: { color: theme.colors.danger, fontFamily: theme.fonts.body }, children: "Failed to load conversations." })
|
|
1485
1535
|
);
|
|
1486
1536
|
}
|
|
1537
|
+
if (conversations.length === 0 && needle && allConversations.length > 0) {
|
|
1538
|
+
return placeholder(
|
|
1539
|
+
typeof noResultsState === "function" ? noResultsState(needle) : noResultsState !== void 0 ? noResultsState : /* @__PURE__ */ jsx(
|
|
1540
|
+
EmptyState,
|
|
1541
|
+
{
|
|
1542
|
+
title: `Nothing matches \u201C${needle}\u201D`,
|
|
1543
|
+
hint: "Check the spelling, or search by a person's or channel's name."
|
|
1544
|
+
}
|
|
1545
|
+
)
|
|
1546
|
+
);
|
|
1547
|
+
}
|
|
1487
1548
|
if (conversations.length === 0) {
|
|
1488
1549
|
return placeholder(
|
|
1489
|
-
|
|
1550
|
+
emptyState == null ? /* @__PURE__ */ jsx(
|
|
1551
|
+
EmptyState,
|
|
1552
|
+
{
|
|
1553
|
+
title: "No conversations yet",
|
|
1554
|
+
hint: "Start a chat with someone, or join a channel \u2014 it shows up here."
|
|
1555
|
+
}
|
|
1556
|
+
) : typeof emptyState === "string" ? /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState }) : emptyState
|
|
1490
1557
|
);
|
|
1491
1558
|
}
|
|
1492
|
-
const footer = loadingMore ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.textSubtle, style:
|
|
1559
|
+
const footer = loadingMore ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.textSubtle, style: styles7.footerSpinner }) : null;
|
|
1493
1560
|
const common = {
|
|
1494
1561
|
style: { backgroundColor: theme.colors.background },
|
|
1495
1562
|
onEndReached: hasMore ? loadMore : void 0,
|
|
@@ -1510,8 +1577,8 @@ function ConversationList({
|
|
|
1510
1577
|
Text,
|
|
1511
1578
|
{
|
|
1512
1579
|
style: [
|
|
1513
|
-
|
|
1514
|
-
density === "compact" ?
|
|
1580
|
+
styles7.sectionTitle,
|
|
1581
|
+
density === "compact" ? styles7.sectionTitleDense : null,
|
|
1515
1582
|
{ color: theme.colors.textMuted, fontFamily: theme.fonts.body }
|
|
1516
1583
|
],
|
|
1517
1584
|
accessibilityRole: "header",
|
|
@@ -1563,7 +1630,7 @@ function ConversationRow({
|
|
|
1563
1630
|
accessibilityState: { selected },
|
|
1564
1631
|
accessibilityLabel: unread > 0 ? `${title}, ${unread} unread` : title,
|
|
1565
1632
|
style: ({ pressed }) => [
|
|
1566
|
-
|
|
1633
|
+
styles7.row,
|
|
1567
1634
|
{
|
|
1568
1635
|
paddingHorizontal: theme.spacing.md,
|
|
1569
1636
|
paddingVertical: dense ? theme.spacing.xs + 2 : theme.spacing.sm + 2,
|
|
@@ -1582,14 +1649,14 @@ function ConversationRow({
|
|
|
1582
1649
|
...presence ? { presence: presence.state, doNotDisturb: !!presence.do_not_disturb } : {}
|
|
1583
1650
|
}
|
|
1584
1651
|
),
|
|
1585
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1586
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1652
|
+
/* @__PURE__ */ jsxs(View, { style: styles7.body, children: [
|
|
1653
|
+
/* @__PURE__ */ jsxs(View, { style: styles7.titleLine, children: [
|
|
1587
1654
|
/* @__PURE__ */ jsx(
|
|
1588
1655
|
Text,
|
|
1589
1656
|
{
|
|
1590
1657
|
style: [
|
|
1591
|
-
|
|
1592
|
-
dense ?
|
|
1658
|
+
styles7.name,
|
|
1659
|
+
dense ? styles7.nameDense : null,
|
|
1593
1660
|
{
|
|
1594
1661
|
color: theme.colors.text,
|
|
1595
1662
|
fontFamily: theme.fonts.body,
|
|
@@ -1604,7 +1671,7 @@ function ConversationRow({
|
|
|
1604
1671
|
Text,
|
|
1605
1672
|
{
|
|
1606
1673
|
style: [
|
|
1607
|
-
|
|
1674
|
+
styles7.time,
|
|
1608
1675
|
{ color: bold ? theme.colors.accentStrong : theme.colors.textSubtle }
|
|
1609
1676
|
],
|
|
1610
1677
|
children: when
|
|
@@ -1615,7 +1682,7 @@ function ConversationRow({
|
|
|
1615
1682
|
Text,
|
|
1616
1683
|
{
|
|
1617
1684
|
style: [
|
|
1618
|
-
|
|
1685
|
+
styles7.preview,
|
|
1619
1686
|
{ color: bold ? theme.colors.textMuted : theme.colors.textSubtle }
|
|
1620
1687
|
],
|
|
1621
1688
|
numberOfLines: 1,
|
|
@@ -1623,12 +1690,12 @@ function ConversationRow({
|
|
|
1623
1690
|
}
|
|
1624
1691
|
) : null
|
|
1625
1692
|
] }),
|
|
1626
|
-
unread > 0 ? /* @__PURE__ */ jsx(View, { style: [
|
|
1693
|
+
unread > 0 ? /* @__PURE__ */ jsx(View, { style: [styles7.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsx(Text, { style: [styles7.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
|
|
1627
1694
|
]
|
|
1628
1695
|
}
|
|
1629
1696
|
);
|
|
1630
1697
|
}
|
|
1631
|
-
var
|
|
1698
|
+
var styles7 = StyleSheet.create({
|
|
1632
1699
|
flex: {
|
|
1633
1700
|
flex: 1
|
|
1634
1701
|
},
|
|
@@ -1833,11 +1900,11 @@ function AttachmentPicker({
|
|
|
1833
1900
|
animationType: "slide",
|
|
1834
1901
|
onRequestClose: onClose,
|
|
1835
1902
|
...EDGE_TO_EDGE_MODAL,
|
|
1836
|
-
children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
1903
|
+
children: /* @__PURE__ */ jsx(Pressable, { style: styles8.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs(
|
|
1837
1904
|
View,
|
|
1838
1905
|
{
|
|
1839
1906
|
style: [
|
|
1840
|
-
|
|
1907
|
+
styles8.sheet,
|
|
1841
1908
|
{
|
|
1842
1909
|
backgroundColor: theme.colors.surface,
|
|
1843
1910
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -1850,19 +1917,19 @@ function AttachmentPicker({
|
|
|
1850
1917
|
theme.shadows.lg
|
|
1851
1918
|
],
|
|
1852
1919
|
children: [
|
|
1853
|
-
camera ? /* @__PURE__ */ jsxs(Pressable, { style:
|
|
1920
|
+
camera ? /* @__PURE__ */ jsxs(Pressable, { style: styles8.item, onPress: () => pickFromKind("camera"), children: [
|
|
1854
1921
|
/* @__PURE__ */ jsx(PoolseIcon, { name: "camera", size: 20, color: theme.colors.textMuted }),
|
|
1855
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1922
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.itemText, { color: theme.colors.text }], children: "Camera" })
|
|
1856
1923
|
] }) : null,
|
|
1857
|
-
/* @__PURE__ */ jsxs(Pressable, { style:
|
|
1924
|
+
/* @__PURE__ */ jsxs(Pressable, { style: styles8.item, onPress: () => pickFromKind("image"), children: [
|
|
1858
1925
|
/* @__PURE__ */ jsx(PoolseIcon, { name: "image", size: 20, color: theme.colors.textMuted }),
|
|
1859
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1926
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.itemText, { color: theme.colors.text }], children: "Photo library" })
|
|
1860
1927
|
] }),
|
|
1861
|
-
/* @__PURE__ */ jsxs(Pressable, { style:
|
|
1928
|
+
/* @__PURE__ */ jsxs(Pressable, { style: styles8.item, onPress: () => pickFromKind("document"), children: [
|
|
1862
1929
|
/* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 20, color: theme.colors.textMuted }),
|
|
1863
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1930
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.itemText, { color: theme.colors.text }], children: "File" })
|
|
1864
1931
|
] }),
|
|
1865
|
-
/* @__PURE__ */ jsx(Pressable, { style:
|
|
1932
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles8.cancel, onPress: onClose, children: /* @__PURE__ */ jsx(Text, { style: [styles8.itemText, { color: theme.colors.accent }], children: "Cancel" }) })
|
|
1866
1933
|
]
|
|
1867
1934
|
}
|
|
1868
1935
|
) })
|
|
@@ -2017,7 +2084,7 @@ async function defaultAdapter(kind, { multiple }) {
|
|
|
2017
2084
|
})
|
|
2018
2085
|
);
|
|
2019
2086
|
}
|
|
2020
|
-
var
|
|
2087
|
+
var styles8 = StyleSheet.create({
|
|
2021
2088
|
backdrop: {
|
|
2022
2089
|
flex: 1,
|
|
2023
2090
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
@@ -2047,14 +2114,14 @@ var styles7 = StyleSheet.create({
|
|
|
2047
2114
|
});
|
|
2048
2115
|
function DaySeparator({ label, variant = "pill" }) {
|
|
2049
2116
|
const theme = useTheme();
|
|
2050
|
-
const rule = variant === "rule" ? /* @__PURE__ */ jsx(View, { style: [
|
|
2051
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
2117
|
+
const rule = variant === "rule" ? /* @__PURE__ */ jsx(View, { style: [styles9.rule, { backgroundColor: theme.colors.border }] }) : null;
|
|
2118
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles9.wrap, rule ? styles9.wrapRule : null], children: [
|
|
2052
2119
|
rule,
|
|
2053
2120
|
/* @__PURE__ */ jsx(
|
|
2054
2121
|
View,
|
|
2055
2122
|
{
|
|
2056
2123
|
style: [
|
|
2057
|
-
|
|
2124
|
+
styles9.chip,
|
|
2058
2125
|
{
|
|
2059
2126
|
backgroundColor: theme.colors.surfaceAlt,
|
|
2060
2127
|
borderColor: theme.colors.border
|
|
@@ -2064,7 +2131,7 @@ function DaySeparator({ label, variant = "pill" }) {
|
|
|
2064
2131
|
Text,
|
|
2065
2132
|
{
|
|
2066
2133
|
style: [
|
|
2067
|
-
|
|
2134
|
+
styles9.label,
|
|
2068
2135
|
{
|
|
2069
2136
|
color: theme.colors.textMuted,
|
|
2070
2137
|
fontFamily: theme.fonts.body
|
|
@@ -2078,7 +2145,7 @@ function DaySeparator({ label, variant = "pill" }) {
|
|
|
2078
2145
|
rule
|
|
2079
2146
|
] });
|
|
2080
2147
|
}
|
|
2081
|
-
var
|
|
2148
|
+
var styles9 = StyleSheet.create({
|
|
2082
2149
|
wrap: {
|
|
2083
2150
|
alignItems: "center",
|
|
2084
2151
|
marginVertical: 8
|
|
@@ -2111,7 +2178,7 @@ function LiveCallBanner({ call, inCall, onJoin }) {
|
|
|
2111
2178
|
return /* @__PURE__ */ jsxs(
|
|
2112
2179
|
View,
|
|
2113
2180
|
{
|
|
2114
|
-
style: [
|
|
2181
|
+
style: [styles10.bar, { backgroundColor: theme.colors.success }],
|
|
2115
2182
|
accessibilityRole: "summary",
|
|
2116
2183
|
accessibilityLabel: `${what}, ${who}`,
|
|
2117
2184
|
children: [
|
|
@@ -2124,9 +2191,9 @@ function LiveCallBanner({ call, inCall, onJoin }) {
|
|
|
2124
2191
|
label: null
|
|
2125
2192
|
}
|
|
2126
2193
|
),
|
|
2127
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2128
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2129
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2194
|
+
/* @__PURE__ */ jsxs(View, { style: styles10.text, children: [
|
|
2195
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.title, { fontFamily: theme.fonts.body }], numberOfLines: 1, children: what }),
|
|
2196
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.meta, { fontFamily: theme.fonts.body }], numberOfLines: 1, children: who })
|
|
2130
2197
|
] }),
|
|
2131
2198
|
/* @__PURE__ */ jsx(
|
|
2132
2199
|
Pressable,
|
|
@@ -2135,11 +2202,11 @@ function LiveCallBanner({ call, inCall, onJoin }) {
|
|
|
2135
2202
|
accessibilityRole: "button",
|
|
2136
2203
|
accessibilityLabel: "Join call",
|
|
2137
2204
|
hitSlop: 8,
|
|
2138
|
-
style: ({ pressed }) => [
|
|
2205
|
+
style: ({ pressed }) => [styles10.join, pressed && styles10.joinPressed],
|
|
2139
2206
|
children: /* @__PURE__ */ jsx(
|
|
2140
2207
|
Text,
|
|
2141
2208
|
{
|
|
2142
|
-
style: [
|
|
2209
|
+
style: [styles10.joinText, { color: theme.colors.success, fontFamily: theme.fonts.body }],
|
|
2143
2210
|
children: "Join"
|
|
2144
2211
|
}
|
|
2145
2212
|
)
|
|
@@ -2149,7 +2216,7 @@ function LiveCallBanner({ call, inCall, onJoin }) {
|
|
|
2149
2216
|
}
|
|
2150
2217
|
);
|
|
2151
2218
|
}
|
|
2152
|
-
var
|
|
2219
|
+
var styles10 = StyleSheet.create({
|
|
2153
2220
|
bar: {
|
|
2154
2221
|
flexDirection: "row",
|
|
2155
2222
|
alignItems: "center",
|
|
@@ -2355,7 +2422,7 @@ function PickerSheet({
|
|
|
2355
2422
|
{
|
|
2356
2423
|
onPress: () => pick(emoji),
|
|
2357
2424
|
style: ({ pressed }) => [
|
|
2358
|
-
|
|
2425
|
+
styles11.cell,
|
|
2359
2426
|
{
|
|
2360
2427
|
borderRadius: theme.radii.sm,
|
|
2361
2428
|
backgroundColor: pressed ? theme.colors.surfaceAlt : void 0
|
|
@@ -2363,15 +2430,15 @@ function PickerSheet({
|
|
|
2363
2430
|
],
|
|
2364
2431
|
accessibilityRole: "button",
|
|
2365
2432
|
accessibilityLabel: emoji,
|
|
2366
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
2433
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles11.emoji, children: emoji })
|
|
2367
2434
|
},
|
|
2368
2435
|
emoji
|
|
2369
2436
|
);
|
|
2370
|
-
return /* @__PURE__ */ jsxs(KeyboardAvoidingView, { style:
|
|
2437
|
+
return /* @__PURE__ */ jsxs(KeyboardAvoidingView, { style: styles11.kav, behavior: "padding", children: [
|
|
2371
2438
|
/* @__PURE__ */ jsx(
|
|
2372
2439
|
Pressable,
|
|
2373
2440
|
{
|
|
2374
|
-
style: [
|
|
2441
|
+
style: [styles11.backdrop, { backgroundColor: theme.colors.overlay }],
|
|
2375
2442
|
onPress: onClose,
|
|
2376
2443
|
accessibilityLabel: "Close emoji picker"
|
|
2377
2444
|
}
|
|
@@ -2380,7 +2447,7 @@ function PickerSheet({
|
|
|
2380
2447
|
View,
|
|
2381
2448
|
{
|
|
2382
2449
|
style: [
|
|
2383
|
-
|
|
2450
|
+
styles11.sheet,
|
|
2384
2451
|
{
|
|
2385
2452
|
height: Math.round(height * 0.55),
|
|
2386
2453
|
backgroundColor: theme.colors.surface,
|
|
@@ -2393,11 +2460,11 @@ function PickerSheet({
|
|
|
2393
2460
|
theme.shadows.lg
|
|
2394
2461
|
],
|
|
2395
2462
|
children: [
|
|
2396
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2463
|
+
/* @__PURE__ */ jsxs(View, { style: styles11.headRow, children: [
|
|
2397
2464
|
/* @__PURE__ */ jsx(
|
|
2398
2465
|
Text,
|
|
2399
2466
|
{
|
|
2400
|
-
style: [
|
|
2467
|
+
style: [styles11.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
|
|
2401
2468
|
accessibilityRole: "header",
|
|
2402
2469
|
children: title
|
|
2403
2470
|
}
|
|
@@ -2408,7 +2475,7 @@ function PickerSheet({
|
|
|
2408
2475
|
View,
|
|
2409
2476
|
{
|
|
2410
2477
|
style: [
|
|
2411
|
-
|
|
2478
|
+
styles11.search,
|
|
2412
2479
|
{ backgroundColor: theme.colors.surfaceAlt, borderRadius: theme.radii.md }
|
|
2413
2480
|
],
|
|
2414
2481
|
children: [
|
|
@@ -2422,19 +2489,19 @@ function PickerSheet({
|
|
|
2422
2489
|
placeholderTextColor: theme.colors.textSubtle,
|
|
2423
2490
|
autoCorrect: false,
|
|
2424
2491
|
autoCapitalize: "none",
|
|
2425
|
-
style: [
|
|
2492
|
+
style: [styles11.searchInput, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
2426
2493
|
accessibilityLabel: "Search emoji"
|
|
2427
2494
|
}
|
|
2428
2495
|
)
|
|
2429
2496
|
]
|
|
2430
2497
|
}
|
|
2431
2498
|
),
|
|
2432
|
-
query.trim() ? results.length > 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
2433
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
2499
|
+
query.trim() ? results.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles11.results, children: results.map((r) => cell(r.emoji)) }) : /* @__PURE__ */ jsx(Text, { style: [styles11.empty, { color: theme.colors.textMuted }], children: "No emoji found." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2500
|
+
/* @__PURE__ */ jsx(View, { style: [styles11.tabs, { borderBottomColor: theme.colors.border }], children: sections.map((s, i) => /* @__PURE__ */ jsx(
|
|
2434
2501
|
Pressable,
|
|
2435
2502
|
{
|
|
2436
2503
|
hitSlop: 4,
|
|
2437
|
-
style:
|
|
2504
|
+
style: styles11.tab,
|
|
2438
2505
|
onPress: () => listRef.current?.scrollToLocation({
|
|
2439
2506
|
sectionIndex: i,
|
|
2440
2507
|
itemIndex: 0,
|
|
@@ -2443,7 +2510,7 @@ function PickerSheet({
|
|
|
2443
2510
|
}),
|
|
2444
2511
|
accessibilityRole: "button",
|
|
2445
2512
|
accessibilityLabel: s.title,
|
|
2446
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
2513
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles11.tabEmoji, children: s.id === "recent" ? "\u{1F558}" : s.data[0]?.[0] })
|
|
2447
2514
|
},
|
|
2448
2515
|
s.id
|
|
2449
2516
|
)) }),
|
|
@@ -2457,8 +2524,8 @@ function PickerSheet({
|
|
|
2457
2524
|
stickySectionHeadersEnabled: false,
|
|
2458
2525
|
initialNumToRender: 8,
|
|
2459
2526
|
onScrollToIndexFailed: () => void 0,
|
|
2460
|
-
renderSectionHeader: ({ section }) => /* @__PURE__ */ jsx(Text, { style: [
|
|
2461
|
-
renderItem: ({ item }) => /* @__PURE__ */ jsx(View, { style:
|
|
2527
|
+
renderSectionHeader: ({ section }) => /* @__PURE__ */ jsx(Text, { style: [styles11.sectionTitle, { color: theme.colors.textMuted }], children: section.title }),
|
|
2528
|
+
renderItem: ({ item }) => /* @__PURE__ */ jsx(View, { style: styles11.gridRow, children: item.map(cell) })
|
|
2462
2529
|
}
|
|
2463
2530
|
)
|
|
2464
2531
|
] })
|
|
@@ -2472,7 +2539,7 @@ function chunk(list, size) {
|
|
|
2472
2539
|
for (let i = 0; i < list.length; i += size) out.push(list.slice(i, i + size));
|
|
2473
2540
|
return out;
|
|
2474
2541
|
}
|
|
2475
|
-
var
|
|
2542
|
+
var styles11 = StyleSheet.create({
|
|
2476
2543
|
kav: {
|
|
2477
2544
|
flex: 1,
|
|
2478
2545
|
justifyContent: "flex-end"
|
|
@@ -2563,8 +2630,8 @@ function UploadQueueStrip() {
|
|
|
2563
2630
|
{
|
|
2564
2631
|
horizontal: true,
|
|
2565
2632
|
showsHorizontalScrollIndicator: false,
|
|
2566
|
-
contentContainerStyle:
|
|
2567
|
-
style: [
|
|
2633
|
+
contentContainerStyle: styles12.scroll,
|
|
2634
|
+
style: [styles12.scrollStyle, { marginBottom: 8 }],
|
|
2568
2635
|
children: upload.queue.map((item) => {
|
|
2569
2636
|
const isError = item.status === "error";
|
|
2570
2637
|
const isUploading = item.status === "uploading" || item.status === "pending";
|
|
@@ -2575,7 +2642,7 @@ function UploadQueueStrip() {
|
|
|
2575
2642
|
if (item.status === "ready" || isError) upload.remove(item.localId);
|
|
2576
2643
|
else upload.cancel(item.localId);
|
|
2577
2644
|
};
|
|
2578
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
2645
|
+
return /* @__PURE__ */ jsxs(View, { style: styles12.tileWrap, children: [
|
|
2579
2646
|
isImage && previewUri ? /* @__PURE__ */ jsx(ImageTile, { uri: previewUri, uploading: isUploading, error: isError }) : /* @__PURE__ */ jsx(
|
|
2580
2647
|
FileTile,
|
|
2581
2648
|
{
|
|
@@ -2590,13 +2657,13 @@ function UploadQueueStrip() {
|
|
|
2590
2657
|
{
|
|
2591
2658
|
onPress: handleClose,
|
|
2592
2659
|
hitSlop: 8,
|
|
2593
|
-
style:
|
|
2660
|
+
style: styles12.closeBtn,
|
|
2594
2661
|
accessibilityLabel: isError ? "Remove failed upload" : "Cancel upload",
|
|
2595
2662
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 11, color: "#fff" })
|
|
2596
2663
|
}
|
|
2597
2664
|
) : null,
|
|
2598
|
-
isUploading ? /* @__PURE__ */ jsx(View, { style:
|
|
2599
|
-
isError ? /* @__PURE__ */ jsx(View, { style: [
|
|
2665
|
+
isUploading ? /* @__PURE__ */ jsx(View, { style: styles12.progressOverlay, children: /* @__PURE__ */ jsx(View, { style: [styles12.spinner, { borderColor: theme.colors.accentText }] }) }) : null,
|
|
2666
|
+
isError ? /* @__PURE__ */ jsx(View, { style: [styles12.errorOverlay, { backgroundColor: "rgba(229,72,77,0.85)" }], children: /* @__PURE__ */ jsx(Text, { style: [styles12.errorText, { color: "#fff" }], children: "Failed" }) }) : null
|
|
2600
2667
|
] }, item.localId);
|
|
2601
2668
|
})
|
|
2602
2669
|
}
|
|
@@ -2609,7 +2676,7 @@ function ImageTile({ uri, uploading, error }) {
|
|
|
2609
2676
|
{
|
|
2610
2677
|
source: { uri },
|
|
2611
2678
|
style: [
|
|
2612
|
-
|
|
2679
|
+
styles12.imageTile,
|
|
2613
2680
|
{
|
|
2614
2681
|
backgroundColor: theme.colors.surfaceAlt,
|
|
2615
2682
|
borderColor: error ? theme.colors.danger : "transparent",
|
|
@@ -2631,24 +2698,24 @@ function FileTile({
|
|
|
2631
2698
|
View,
|
|
2632
2699
|
{
|
|
2633
2700
|
style: [
|
|
2634
|
-
|
|
2701
|
+
styles12.fileTile,
|
|
2635
2702
|
{
|
|
2636
2703
|
backgroundColor: theme.colors.surfaceAlt,
|
|
2637
2704
|
borderColor: error ? theme.colors.danger : uploading ? theme.colors.accent : theme.colors.border
|
|
2638
2705
|
}
|
|
2639
2706
|
],
|
|
2640
2707
|
children: [
|
|
2641
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
2642
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2708
|
+
/* @__PURE__ */ jsx(View, { style: [styles12.fileIconBox, { backgroundColor: theme.colors.accentSoft }], children: /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 18, color: theme.colors.accent }) }),
|
|
2709
|
+
/* @__PURE__ */ jsxs(View, { style: styles12.fileInfo, children: [
|
|
2643
2710
|
/* @__PURE__ */ jsx(
|
|
2644
2711
|
Text,
|
|
2645
2712
|
{
|
|
2646
|
-
style: [
|
|
2713
|
+
style: [styles12.fileName, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
2647
2714
|
numberOfLines: 1,
|
|
2648
2715
|
children: filename
|
|
2649
2716
|
}
|
|
2650
2717
|
),
|
|
2651
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2718
|
+
/* @__PURE__ */ jsx(Text, { style: [styles12.fileSize, { color: theme.colors.textSubtle }], children: formatBytes2(size) })
|
|
2652
2719
|
] })
|
|
2653
2720
|
]
|
|
2654
2721
|
}
|
|
@@ -2662,7 +2729,7 @@ function formatBytes2(n) {
|
|
|
2662
2729
|
return `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
2663
2730
|
}
|
|
2664
2731
|
var TILE = 64;
|
|
2665
|
-
var
|
|
2732
|
+
var styles12 = StyleSheet.create({
|
|
2666
2733
|
scrollStyle: {
|
|
2667
2734
|
overflow: "visible"
|
|
2668
2735
|
},
|
|
@@ -2896,7 +2963,7 @@ var MessageComposer = forwardRef(
|
|
|
2896
2963
|
View,
|
|
2897
2964
|
{
|
|
2898
2965
|
style: [
|
|
2899
|
-
|
|
2966
|
+
styles13.wrap,
|
|
2900
2967
|
{
|
|
2901
2968
|
backgroundColor: theme.colors.surface,
|
|
2902
2969
|
borderTopColor: theme.colors.border,
|
|
@@ -2920,13 +2987,14 @@ var MessageComposer = forwardRef(
|
|
|
2920
2987
|
) : null,
|
|
2921
2988
|
attachments && !isEditing ? /* @__PURE__ */ jsx(UploadQueueStrip, {}) : null,
|
|
2922
2989
|
isEditing ? null : accessory,
|
|
2923
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2990
|
+
/* @__PURE__ */ jsxs(View, { style: styles13.row, children: [
|
|
2924
2991
|
attachments && onAttachPress ? /* @__PURE__ */ jsx(
|
|
2925
2992
|
Pressable,
|
|
2926
2993
|
{
|
|
2927
2994
|
onPress: onAttachPress,
|
|
2928
2995
|
hitSlop: 8,
|
|
2929
|
-
style:
|
|
2996
|
+
style: styles13.iconBtn,
|
|
2997
|
+
accessibilityRole: "button",
|
|
2930
2998
|
accessibilityLabel: "Attach file",
|
|
2931
2999
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 22, color: theme.colors.textMuted })
|
|
2932
3000
|
}
|
|
@@ -2936,7 +3004,7 @@ var MessageComposer = forwardRef(
|
|
|
2936
3004
|
{
|
|
2937
3005
|
onPress: () => setEmojiOpen(true),
|
|
2938
3006
|
hitSlop: 8,
|
|
2939
|
-
style:
|
|
3007
|
+
style: styles13.iconBtn,
|
|
2940
3008
|
accessibilityRole: "button",
|
|
2941
3009
|
accessibilityLabel: "Insert emoji",
|
|
2942
3010
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "emoji", size: 22, color: theme.colors.textMuted, label: null })
|
|
@@ -2956,11 +3024,12 @@ var MessageComposer = forwardRef(
|
|
|
2956
3024
|
if (!isEditing) onSelectionChange?.(e.nativeEvent.selection);
|
|
2957
3025
|
},
|
|
2958
3026
|
placeholder,
|
|
3027
|
+
accessibilityLabel: placeholder,
|
|
2959
3028
|
placeholderTextColor: theme.colors.textSubtle,
|
|
2960
3029
|
multiline: true,
|
|
2961
3030
|
editable: !disabled,
|
|
2962
3031
|
style: [
|
|
2963
|
-
|
|
3032
|
+
styles13.input,
|
|
2964
3033
|
{
|
|
2965
3034
|
color: theme.colors.text,
|
|
2966
3035
|
backgroundColor: theme.colors.surfaceAlt,
|
|
@@ -2977,12 +3046,13 @@ var MessageComposer = forwardRef(
|
|
|
2977
3046
|
onPress: handleSend,
|
|
2978
3047
|
disabled: submitDisabled,
|
|
2979
3048
|
style: [
|
|
2980
|
-
|
|
3049
|
+
styles13.sendBtn,
|
|
2981
3050
|
{
|
|
2982
3051
|
backgroundColor: submitDisabled ? theme.colors.textSubtle : theme.colors.accent,
|
|
2983
3052
|
opacity: submitDisabled ? 0.6 : 1
|
|
2984
3053
|
}
|
|
2985
3054
|
],
|
|
3055
|
+
accessibilityRole: "button",
|
|
2986
3056
|
accessibilityLabel: "Send message",
|
|
2987
3057
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "send", size: 18, color: theme.colors.accentText })
|
|
2988
3058
|
}
|
|
@@ -3020,7 +3090,7 @@ function EditChip({ message, onCancel }) {
|
|
|
3020
3090
|
View,
|
|
3021
3091
|
{
|
|
3022
3092
|
style: [
|
|
3023
|
-
|
|
3093
|
+
styles13.replyChip,
|
|
3024
3094
|
{
|
|
3025
3095
|
backgroundColor: theme.colors.surfaceAlt,
|
|
3026
3096
|
borderLeftColor: theme.colors.accent
|
|
@@ -3028,10 +3098,10 @@ function EditChip({ message, onCancel }) {
|
|
|
3028
3098
|
],
|
|
3029
3099
|
children: [
|
|
3030
3100
|
/* @__PURE__ */ jsxs(View, { style: { flex: 1 }, children: [
|
|
3031
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3032
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3101
|
+
/* @__PURE__ */ jsx(Text, { style: [styles13.replyName, { color: theme.colors.accent }], children: "Editing message" }),
|
|
3102
|
+
/* @__PURE__ */ jsx(Text, { style: [styles13.replyBody, { color: theme.colors.textMuted }], numberOfLines: 1, children: message.body ?? "\u2026" })
|
|
3033
3103
|
] }),
|
|
3034
|
-
onCancel ? /* @__PURE__ */ jsx(Pressable, { onPress: onCancel, hitSlop: 8, style:
|
|
3104
|
+
onCancel ? /* @__PURE__ */ jsx(Pressable, { onPress: onCancel, hitSlop: 8, style: styles13.replyCancel, children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
|
|
3035
3105
|
]
|
|
3036
3106
|
}
|
|
3037
3107
|
);
|
|
@@ -3048,7 +3118,7 @@ function ReplyChip({
|
|
|
3048
3118
|
View,
|
|
3049
3119
|
{
|
|
3050
3120
|
style: [
|
|
3051
|
-
|
|
3121
|
+
styles13.replyChip,
|
|
3052
3122
|
{
|
|
3053
3123
|
backgroundColor: theme.colors.surfaceAlt,
|
|
3054
3124
|
borderLeftColor: theme.colors.accent
|
|
@@ -3056,18 +3126,18 @@ function ReplyChip({
|
|
|
3056
3126
|
],
|
|
3057
3127
|
children: [
|
|
3058
3128
|
/* @__PURE__ */ jsxs(View, { style: { flex: 1 }, children: [
|
|
3059
|
-
/* @__PURE__ */ jsxs(Text, { style: [
|
|
3129
|
+
/* @__PURE__ */ jsxs(Text, { style: [styles13.replyName, { color: theme.colors.accent }], children: [
|
|
3060
3130
|
"Replying to ",
|
|
3061
3131
|
senderName
|
|
3062
3132
|
] }),
|
|
3063
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3133
|
+
/* @__PURE__ */ jsx(Text, { style: [styles13.replyBody, { color: theme.colors.textMuted }], numberOfLines: 1, children: message.body ?? "\u2026" })
|
|
3064
3134
|
] }),
|
|
3065
|
-
onCancel ? /* @__PURE__ */ jsx(Pressable, { onPress: onCancel, hitSlop: 8, style:
|
|
3135
|
+
onCancel ? /* @__PURE__ */ jsx(Pressable, { onPress: onCancel, hitSlop: 8, style: styles13.replyCancel, children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
|
|
3066
3136
|
]
|
|
3067
3137
|
}
|
|
3068
3138
|
);
|
|
3069
3139
|
}
|
|
3070
|
-
var
|
|
3140
|
+
var styles13 = StyleSheet.create({
|
|
3071
3141
|
wrap: {
|
|
3072
3142
|
borderTopWidth: StyleSheet.hairlineWidth,
|
|
3073
3143
|
paddingTop: 8,
|
|
@@ -3178,7 +3248,7 @@ function MentionInput({
|
|
|
3178
3248
|
View,
|
|
3179
3249
|
{
|
|
3180
3250
|
style: [
|
|
3181
|
-
|
|
3251
|
+
styles14.suggestions,
|
|
3182
3252
|
{
|
|
3183
3253
|
backgroundColor: theme.colors.surface,
|
|
3184
3254
|
borderColor: theme.colors.border,
|
|
@@ -3189,7 +3259,7 @@ function MentionInput({
|
|
|
3189
3259
|
accessibilityRole: "menu",
|
|
3190
3260
|
accessibilityLabel: "Mention suggestions",
|
|
3191
3261
|
children: [
|
|
3192
|
-
/* @__PURE__ */ jsx(ScrollView, { keyboardShouldPersistTaps: "always", style:
|
|
3262
|
+
/* @__PURE__ */ jsx(ScrollView, { keyboardShouldPersistTaps: "always", style: styles14.suggestionScroll, children: candidates.map((c) => /* @__PURE__ */ jsx(
|
|
3193
3263
|
MentionRow,
|
|
3194
3264
|
{
|
|
3195
3265
|
externalId: c.externalId,
|
|
@@ -3202,7 +3272,7 @@ function MentionInput({
|
|
|
3202
3272
|
Pressable,
|
|
3203
3273
|
{
|
|
3204
3274
|
onPress: () => setDismissedAt(query.start),
|
|
3205
|
-
style:
|
|
3275
|
+
style: styles14.dismiss,
|
|
3206
3276
|
accessibilityRole: "button",
|
|
3207
3277
|
accessibilityLabel: "Dismiss suggestions",
|
|
3208
3278
|
hitSlop: 6,
|
|
@@ -3245,7 +3315,7 @@ function MentionRow({
|
|
|
3245
3315
|
{
|
|
3246
3316
|
onPress,
|
|
3247
3317
|
style: ({ pressed }) => [
|
|
3248
|
-
|
|
3318
|
+
styles14.row,
|
|
3249
3319
|
{ backgroundColor: pressed ? theme.colors.surfaceAlt : "transparent" }
|
|
3250
3320
|
],
|
|
3251
3321
|
accessibilityRole: "menuitem",
|
|
@@ -3255,7 +3325,7 @@ function MentionRow({
|
|
|
3255
3325
|
/* @__PURE__ */ jsx(
|
|
3256
3326
|
Text,
|
|
3257
3327
|
{
|
|
3258
|
-
style: [
|
|
3328
|
+
style: [styles14.rowText, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
3259
3329
|
numberOfLines: 1,
|
|
3260
3330
|
children: name
|
|
3261
3331
|
}
|
|
@@ -3264,7 +3334,7 @@ function MentionRow({
|
|
|
3264
3334
|
}
|
|
3265
3335
|
);
|
|
3266
3336
|
}
|
|
3267
|
-
var
|
|
3337
|
+
var styles14 = StyleSheet.create({
|
|
3268
3338
|
suggestions: {
|
|
3269
3339
|
borderWidth: StyleSheet.hairlineWidth,
|
|
3270
3340
|
marginBottom: 8,
|
|
@@ -3396,15 +3466,15 @@ function MessageList({
|
|
|
3396
3466
|
[renderItem, data.length]
|
|
3397
3467
|
);
|
|
3398
3468
|
if (loading && messages.length === 0) {
|
|
3399
|
-
return /* @__PURE__ */ jsx(View, { style: [
|
|
3469
|
+
return /* @__PURE__ */ jsx(View, { style: [styles15.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.accent }) });
|
|
3400
3470
|
}
|
|
3401
3471
|
if (messages.length === 0) {
|
|
3402
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
3403
|
-
ListHeader ? /* @__PURE__ */ jsx(View, { style:
|
|
3472
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles15.placeholder, { backgroundColor: theme.colors.background }], children: [
|
|
3473
|
+
ListHeader ? /* @__PURE__ */ jsx(View, { style: styles15.emptyHeader, children: ListHeader }) : null,
|
|
3404
3474
|
typeof emptyState === "string" ? /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState }) : emptyState ?? null
|
|
3405
3475
|
] });
|
|
3406
3476
|
}
|
|
3407
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3477
|
+
return /* @__PURE__ */ jsxs(View, { style: styles15.root, children: [
|
|
3408
3478
|
/* @__PURE__ */ jsx(
|
|
3409
3479
|
FlatList,
|
|
3410
3480
|
{
|
|
@@ -3434,7 +3504,7 @@ function MessageList({
|
|
|
3434
3504
|
{
|
|
3435
3505
|
onPress: scrollToBottom,
|
|
3436
3506
|
style: [
|
|
3437
|
-
|
|
3507
|
+
styles15.jumpButton,
|
|
3438
3508
|
{
|
|
3439
3509
|
backgroundColor: theme.colors.accent
|
|
3440
3510
|
},
|
|
@@ -3443,7 +3513,7 @@ function MessageList({
|
|
|
3443
3513
|
accessibilityLabel: `${newCount} new ${newCount === 1 ? "message" : "messages"}, jump to latest`,
|
|
3444
3514
|
children: [
|
|
3445
3515
|
/* @__PURE__ */ jsx(PoolseIcon, { name: "chevron-down", size: 14, color: theme.colors.accentText }),
|
|
3446
|
-
/* @__PURE__ */ jsxs(Text, { style: [
|
|
3516
|
+
/* @__PURE__ */ jsxs(Text, { style: [styles15.jumpText, { color: theme.colors.accentText }], children: [
|
|
3447
3517
|
newCount,
|
|
3448
3518
|
" new ",
|
|
3449
3519
|
newCount === 1 ? "message" : "messages"
|
|
@@ -3454,7 +3524,7 @@ function MessageList({
|
|
|
3454
3524
|
] });
|
|
3455
3525
|
}
|
|
3456
3526
|
var VIEWABILITY = { itemVisiblePercentThreshold: 50 };
|
|
3457
|
-
var
|
|
3527
|
+
var styles15 = StyleSheet.create({
|
|
3458
3528
|
root: {
|
|
3459
3529
|
flex: 1
|
|
3460
3530
|
},
|
|
@@ -3493,13 +3563,13 @@ function CallLogRow({ msg, meId, onCallBack }) {
|
|
|
3493
3563
|
const accent = display.missed ? theme.colors.danger : theme.colors.textSubtle;
|
|
3494
3564
|
const time = formatTime(msg.inserted_at);
|
|
3495
3565
|
const label = [display.title, display.detail, time].filter(Boolean).join(", ");
|
|
3496
|
-
const metaStyle = [
|
|
3497
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3566
|
+
const metaStyle = [styles16.meta, { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }];
|
|
3567
|
+
return /* @__PURE__ */ jsxs(View, { style: styles16.wrap, accessible: true, accessibilityLabel: label, children: [
|
|
3498
3568
|
/* @__PURE__ */ jsxs(
|
|
3499
3569
|
View,
|
|
3500
3570
|
{
|
|
3501
3571
|
style: [
|
|
3502
|
-
|
|
3572
|
+
styles16.chip,
|
|
3503
3573
|
{
|
|
3504
3574
|
backgroundColor: theme.colors.surfaceAlt,
|
|
3505
3575
|
borderColor: theme.colors.border
|
|
@@ -3511,7 +3581,7 @@ function CallLogRow({ msg, meId, onCallBack }) {
|
|
|
3511
3581
|
Text,
|
|
3512
3582
|
{
|
|
3513
3583
|
style: [
|
|
3514
|
-
|
|
3584
|
+
styles16.title,
|
|
3515
3585
|
{
|
|
3516
3586
|
color: display.missed ? theme.colors.danger : theme.colors.textMuted,
|
|
3517
3587
|
fontFamily: theme.fonts.body
|
|
@@ -3539,12 +3609,12 @@ function CallLogRow({ msg, meId, onCallBack }) {
|
|
|
3539
3609
|
accessibilityRole: "button",
|
|
3540
3610
|
accessibilityLabel: display.media === "video" ? "Video call back" : "Call back",
|
|
3541
3611
|
hitSlop: 8,
|
|
3542
|
-
style: ({ pressed }) => [
|
|
3612
|
+
style: ({ pressed }) => [styles16.callBack, pressed && styles16.callBackPressed],
|
|
3543
3613
|
children: /* @__PURE__ */ jsx(
|
|
3544
3614
|
Text,
|
|
3545
3615
|
{
|
|
3546
3616
|
style: [
|
|
3547
|
-
|
|
3617
|
+
styles16.callBackText,
|
|
3548
3618
|
{ color: theme.colors.accent, fontFamily: theme.fonts.body }
|
|
3549
3619
|
],
|
|
3550
3620
|
children: "Call back"
|
|
@@ -3559,7 +3629,7 @@ function formatTime(iso) {
|
|
|
3559
3629
|
if (Number.isNaN(d.getTime())) return "";
|
|
3560
3630
|
return d.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
|
|
3561
3631
|
}
|
|
3562
|
-
var
|
|
3632
|
+
var styles16 = StyleSheet.create({
|
|
3563
3633
|
wrap: {
|
|
3564
3634
|
alignItems: "center",
|
|
3565
3635
|
alignSelf: "stretch",
|
|
@@ -3633,12 +3703,12 @@ function EditHistorySheet({
|
|
|
3633
3703
|
live = false;
|
|
3634
3704
|
};
|
|
3635
3705
|
}, [visible, messageId, chat]);
|
|
3636
|
-
const entry = (key, label, body, when) => /* @__PURE__ */ jsxs(View, { style: [
|
|
3637
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3638
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3639
|
-
when ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3706
|
+
const entry = (key, label, body, when) => /* @__PURE__ */ jsxs(View, { style: [styles17.entry, { borderBottomColor: theme.colors.border }], children: [
|
|
3707
|
+
/* @__PURE__ */ jsxs(View, { style: styles17.entryHead, children: [
|
|
3708
|
+
/* @__PURE__ */ jsx(Text, { style: [styles17.entryLabel, { color: theme.colors.textMuted }], children: label }),
|
|
3709
|
+
when ? /* @__PURE__ */ jsx(Text, { style: [styles17.entryTime, { color: theme.colors.textSubtle }], children: when }) : null
|
|
3640
3710
|
] }),
|
|
3641
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3711
|
+
/* @__PURE__ */ jsx(Text, { style: [styles17.entryBody, { color: theme.colors.text, fontFamily: theme.fonts.body }], children: body ?? "\u2014" })
|
|
3642
3712
|
] }, key);
|
|
3643
3713
|
return /* @__PURE__ */ jsx(
|
|
3644
3714
|
Modal,
|
|
@@ -3651,14 +3721,14 @@ function EditHistorySheet({
|
|
|
3651
3721
|
children: /* @__PURE__ */ jsx(
|
|
3652
3722
|
Pressable,
|
|
3653
3723
|
{
|
|
3654
|
-
style: [
|
|
3724
|
+
style: [styles17.backdrop, { backgroundColor: theme.colors.overlay }],
|
|
3655
3725
|
onPress: onClose,
|
|
3656
3726
|
children: /* @__PURE__ */ jsxs(
|
|
3657
3727
|
Pressable,
|
|
3658
3728
|
{
|
|
3659
3729
|
onPress: () => void 0,
|
|
3660
3730
|
style: [
|
|
3661
|
-
|
|
3731
|
+
styles17.sheet,
|
|
3662
3732
|
{
|
|
3663
3733
|
backgroundColor: theme.colors.surface,
|
|
3664
3734
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -3673,12 +3743,12 @@ function EditHistorySheet({
|
|
|
3673
3743
|
/* @__PURE__ */ jsx(
|
|
3674
3744
|
Text,
|
|
3675
3745
|
{
|
|
3676
|
-
style: [
|
|
3746
|
+
style: [styles17.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
|
|
3677
3747
|
accessibilityRole: "header",
|
|
3678
3748
|
children: "Edit history"
|
|
3679
3749
|
}
|
|
3680
3750
|
),
|
|
3681
|
-
failed ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3751
|
+
failed ? /* @__PURE__ */ jsx(Text, { style: [styles17.status, { color: theme.colors.textMuted }], children: "Couldn't load the earlier versions." }) : edits === null ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.accent, style: styles17.spinner }) : /* @__PURE__ */ jsxs(ScrollView, { style: styles17.scroll, children: [
|
|
3682
3752
|
currentBody !== void 0 ? entry("current", "Current", currentBody, "") : null,
|
|
3683
3753
|
edits.map(
|
|
3684
3754
|
(e) => entry(
|
|
@@ -3688,7 +3758,7 @@ function EditHistorySheet({
|
|
|
3688
3758
|
relativeTime(e.written_at)
|
|
3689
3759
|
)
|
|
3690
3760
|
),
|
|
3691
|
-
edits.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3761
|
+
edits.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [styles17.status, { color: theme.colors.textMuted }], children: "No earlier versions." }) : null
|
|
3692
3762
|
] })
|
|
3693
3763
|
]
|
|
3694
3764
|
}
|
|
@@ -3698,7 +3768,7 @@ function EditHistorySheet({
|
|
|
3698
3768
|
}
|
|
3699
3769
|
);
|
|
3700
3770
|
}
|
|
3701
|
-
var
|
|
3771
|
+
var styles17 = StyleSheet.create({
|
|
3702
3772
|
backdrop: {
|
|
3703
3773
|
flex: 1,
|
|
3704
3774
|
justifyContent: "flex-end"
|
|
@@ -3776,7 +3846,7 @@ function AttachmentPreview({
|
|
|
3776
3846
|
View,
|
|
3777
3847
|
{
|
|
3778
3848
|
style: [
|
|
3779
|
-
|
|
3849
|
+
styles18.imagePlaceholder,
|
|
3780
3850
|
{
|
|
3781
3851
|
width: maxWidth,
|
|
3782
3852
|
height: 200,
|
|
@@ -3796,7 +3866,7 @@ function AttachmentPreview({
|
|
|
3796
3866
|
onPress,
|
|
3797
3867
|
disabled: !onPress,
|
|
3798
3868
|
style: [
|
|
3799
|
-
|
|
3869
|
+
styles18.fileCard,
|
|
3800
3870
|
{
|
|
3801
3871
|
backgroundColor: onBrand ? "rgba(255,255,255,0.18)" : theme.colors.surfaceAlt,
|
|
3802
3872
|
borderColor: onBrand ? "transparent" : theme.colors.border,
|
|
@@ -3809,12 +3879,12 @@ function AttachmentPreview({
|
|
|
3809
3879
|
/* @__PURE__ */ jsx(
|
|
3810
3880
|
Text,
|
|
3811
3881
|
{
|
|
3812
|
-
style: [
|
|
3882
|
+
style: [styles18.fileName, { color: ink, fontFamily: theme.fonts.body }],
|
|
3813
3883
|
numberOfLines: 1,
|
|
3814
3884
|
children: attachment.original_filename ?? "file"
|
|
3815
3885
|
}
|
|
3816
3886
|
),
|
|
3817
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3887
|
+
/* @__PURE__ */ jsx(Text, { style: [styles18.fileSize, { color: inkSoft, opacity: onBrand ? 0.8 : 1 }], children: formatBytes3(attachment.byte_size) })
|
|
3818
3888
|
] })
|
|
3819
3889
|
]
|
|
3820
3890
|
}
|
|
@@ -3826,7 +3896,7 @@ function formatBytes3(n) {
|
|
|
3826
3896
|
if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
3827
3897
|
return `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
3828
3898
|
}
|
|
3829
|
-
var
|
|
3899
|
+
var styles18 = StyleSheet.create({
|
|
3830
3900
|
imagePlaceholder: {},
|
|
3831
3901
|
fileCard: {
|
|
3832
3902
|
flexDirection: "row",
|
|
@@ -3862,7 +3932,7 @@ function ImageMosaic({
|
|
|
3862
3932
|
View,
|
|
3863
3933
|
{
|
|
3864
3934
|
style: [
|
|
3865
|
-
|
|
3935
|
+
styles19.root,
|
|
3866
3936
|
{
|
|
3867
3937
|
borderTopLeftRadius: r,
|
|
3868
3938
|
borderTopRightRadius: r,
|
|
@@ -3883,18 +3953,18 @@ function ImageMosaic({
|
|
|
3883
3953
|
{
|
|
3884
3954
|
onLongPress,
|
|
3885
3955
|
attachment: visible[0],
|
|
3886
|
-
style:
|
|
3956
|
+
style: styles19.tileFull,
|
|
3887
3957
|
onPress: () => setViewerIndex(0),
|
|
3888
3958
|
overlay: null
|
|
3889
3959
|
}
|
|
3890
3960
|
) : null,
|
|
3891
|
-
n === 2 ? /* @__PURE__ */ jsxs(View, { style:
|
|
3961
|
+
n === 2 ? /* @__PURE__ */ jsxs(View, { style: styles19.rowEven, children: [
|
|
3892
3962
|
/* @__PURE__ */ jsx(
|
|
3893
3963
|
Tile,
|
|
3894
3964
|
{
|
|
3895
3965
|
onLongPress,
|
|
3896
3966
|
attachment: visible[0],
|
|
3897
|
-
style:
|
|
3967
|
+
style: styles19.tileHalfSquare,
|
|
3898
3968
|
onPress: () => setViewerIndex(0),
|
|
3899
3969
|
overlay: null
|
|
3900
3970
|
}
|
|
@@ -3904,7 +3974,7 @@ function ImageMosaic({
|
|
|
3904
3974
|
{
|
|
3905
3975
|
onLongPress,
|
|
3906
3976
|
attachment: visible[1],
|
|
3907
|
-
style:
|
|
3977
|
+
style: styles19.tileHalfSquare,
|
|
3908
3978
|
onPress: () => setViewerIndex(1),
|
|
3909
3979
|
overlay: null
|
|
3910
3980
|
}
|
|
@@ -3916,18 +3986,18 @@ function ImageMosaic({
|
|
|
3916
3986
|
{
|
|
3917
3987
|
onLongPress,
|
|
3918
3988
|
attachment: visible[0],
|
|
3919
|
-
style:
|
|
3989
|
+
style: styles19.tileHero,
|
|
3920
3990
|
onPress: () => setViewerIndex(0),
|
|
3921
3991
|
overlay: null
|
|
3922
3992
|
}
|
|
3923
3993
|
),
|
|
3924
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
3994
|
+
/* @__PURE__ */ jsxs(View, { style: [styles19.rowEven, { marginTop: 2 }], children: [
|
|
3925
3995
|
/* @__PURE__ */ jsx(
|
|
3926
3996
|
Tile,
|
|
3927
3997
|
{
|
|
3928
3998
|
onLongPress,
|
|
3929
3999
|
attachment: visible[1],
|
|
3930
|
-
style:
|
|
4000
|
+
style: styles19.tileHalfSquare,
|
|
3931
4001
|
onPress: () => setViewerIndex(1),
|
|
3932
4002
|
overlay: null
|
|
3933
4003
|
}
|
|
@@ -3937,7 +4007,7 @@ function ImageMosaic({
|
|
|
3937
4007
|
{
|
|
3938
4008
|
onLongPress,
|
|
3939
4009
|
attachment: visible[2],
|
|
3940
|
-
style:
|
|
4010
|
+
style: styles19.tileHalfSquare,
|
|
3941
4011
|
onPress: () => setViewerIndex(2),
|
|
3942
4012
|
overlay: null
|
|
3943
4013
|
}
|
|
@@ -3945,13 +4015,13 @@ function ImageMosaic({
|
|
|
3945
4015
|
] })
|
|
3946
4016
|
] }) : null,
|
|
3947
4017
|
n === 4 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3948
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4018
|
+
/* @__PURE__ */ jsxs(View, { style: styles19.rowEven, children: [
|
|
3949
4019
|
/* @__PURE__ */ jsx(
|
|
3950
4020
|
Tile,
|
|
3951
4021
|
{
|
|
3952
4022
|
onLongPress,
|
|
3953
4023
|
attachment: visible[0],
|
|
3954
|
-
style:
|
|
4024
|
+
style: styles19.tileHalfSquare,
|
|
3955
4025
|
onPress: () => setViewerIndex(0),
|
|
3956
4026
|
overlay: null
|
|
3957
4027
|
}
|
|
@@ -3961,19 +4031,19 @@ function ImageMosaic({
|
|
|
3961
4031
|
{
|
|
3962
4032
|
onLongPress,
|
|
3963
4033
|
attachment: visible[1],
|
|
3964
|
-
style:
|
|
4034
|
+
style: styles19.tileHalfSquare,
|
|
3965
4035
|
onPress: () => setViewerIndex(1),
|
|
3966
4036
|
overlay: null
|
|
3967
4037
|
}
|
|
3968
4038
|
)
|
|
3969
4039
|
] }),
|
|
3970
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
4040
|
+
/* @__PURE__ */ jsxs(View, { style: [styles19.rowEven, { marginTop: 2 }], children: [
|
|
3971
4041
|
/* @__PURE__ */ jsx(
|
|
3972
4042
|
Tile,
|
|
3973
4043
|
{
|
|
3974
4044
|
onLongPress,
|
|
3975
4045
|
attachment: visible[2],
|
|
3976
|
-
style:
|
|
4046
|
+
style: styles19.tileHalfSquare,
|
|
3977
4047
|
onPress: () => setViewerIndex(2),
|
|
3978
4048
|
overlay: null
|
|
3979
4049
|
}
|
|
@@ -3983,7 +4053,7 @@ function ImageMosaic({
|
|
|
3983
4053
|
{
|
|
3984
4054
|
onLongPress,
|
|
3985
4055
|
attachment: visible[3],
|
|
3986
|
-
style:
|
|
4056
|
+
style: styles19.tileHalfSquare,
|
|
3987
4057
|
onPress: () => setViewerIndex(3),
|
|
3988
4058
|
overlay: overflow > 0 ? `+${overflow}` : null
|
|
3989
4059
|
}
|
|
@@ -4021,18 +4091,18 @@ function Tile({
|
|
|
4021
4091
|
}) {
|
|
4022
4092
|
const theme = useTheme();
|
|
4023
4093
|
const { url } = useAttachmentUrl(attachment.id);
|
|
4024
|
-
return /* @__PURE__ */ jsxs(Pressable, { onPress, onLongPress, style: [
|
|
4094
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress, onLongPress, style: [styles19.tileBase, style], children: [
|
|
4025
4095
|
url ? /* @__PURE__ */ jsx(
|
|
4026
4096
|
Image,
|
|
4027
4097
|
{
|
|
4028
4098
|
source: { uri: url },
|
|
4029
|
-
style: [
|
|
4099
|
+
style: [styles19.tileImage, { backgroundColor: theme.colors.surfaceAlt }],
|
|
4030
4100
|
resizeMode: "cover",
|
|
4031
4101
|
accessible: true,
|
|
4032
4102
|
accessibilityLabel: attachment.original_filename ?? "image"
|
|
4033
4103
|
}
|
|
4034
|
-
) : /* @__PURE__ */ jsx(View, { style: [
|
|
4035
|
-
overlay ? /* @__PURE__ */ jsx(View, { style:
|
|
4104
|
+
) : /* @__PURE__ */ jsx(View, { style: [styles19.tileImage, { backgroundColor: theme.colors.surfaceAlt }] }),
|
|
4105
|
+
overlay ? /* @__PURE__ */ jsx(View, { style: styles19.overflow, children: /* @__PURE__ */ jsx(Text, { style: styles19.overflowText, children: overlay }) }) : null
|
|
4036
4106
|
] });
|
|
4037
4107
|
}
|
|
4038
4108
|
function FullScreenViewer({
|
|
@@ -4042,7 +4112,7 @@ function FullScreenViewer({
|
|
|
4042
4112
|
const { url } = useAttachmentUrl(attachment.id);
|
|
4043
4113
|
const { width, height } = useWindowDimensions();
|
|
4044
4114
|
const insets = useSafeInsets();
|
|
4045
|
-
return /* @__PURE__ */ jsxs(Pressable, { style:
|
|
4115
|
+
return /* @__PURE__ */ jsxs(Pressable, { style: styles19.viewer, onPress: onClose, children: [
|
|
4046
4116
|
url ? /* @__PURE__ */ jsx(
|
|
4047
4117
|
Image,
|
|
4048
4118
|
{
|
|
@@ -4058,14 +4128,14 @@ function FullScreenViewer({
|
|
|
4058
4128
|
{
|
|
4059
4129
|
onPress: onClose,
|
|
4060
4130
|
hitSlop: 12,
|
|
4061
|
-
style: [
|
|
4131
|
+
style: [styles19.closeBtn, { top: insets.top + 12, right: insets.right + 16 }],
|
|
4062
4132
|
accessibilityLabel: "Close viewer",
|
|
4063
4133
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 20, color: "#ffffff" })
|
|
4064
4134
|
}
|
|
4065
4135
|
)
|
|
4066
4136
|
] });
|
|
4067
4137
|
}
|
|
4068
|
-
var
|
|
4138
|
+
var styles19 = StyleSheet.create({
|
|
4069
4139
|
root: {
|
|
4070
4140
|
width: "100%",
|
|
4071
4141
|
overflow: "hidden",
|
|
@@ -4238,7 +4308,7 @@ function LinkPreviewCard({
|
|
|
4238
4308
|
{
|
|
4239
4309
|
onPress: onRemove,
|
|
4240
4310
|
hitSlop: 8,
|
|
4241
|
-
style: [
|
|
4311
|
+
style: [styles20.remove, { backgroundColor: theme.colors.overlay }],
|
|
4242
4312
|
accessibilityRole: "button",
|
|
4243
4313
|
accessibilityLabel: "Remove preview",
|
|
4244
4314
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 12, color: "#FFFFFF", label: null })
|
|
@@ -4254,13 +4324,13 @@ function LinkPreviewCard({
|
|
|
4254
4324
|
...onLongPress ? { onLongPress } : {},
|
|
4255
4325
|
accessibilityRole: "link",
|
|
4256
4326
|
accessibilityLabel: preview.title || "Image link",
|
|
4257
|
-
style: [
|
|
4327
|
+
style: [styles20.imageOnly, { maxWidth, borderRadius: theme.radii.md }],
|
|
4258
4328
|
children: [
|
|
4259
4329
|
/* @__PURE__ */ jsx(
|
|
4260
4330
|
Image,
|
|
4261
4331
|
{
|
|
4262
4332
|
source: { uri: src },
|
|
4263
|
-
style: [
|
|
4333
|
+
style: [styles20.inlineImage, { borderRadius: theme.radii.md }],
|
|
4264
4334
|
resizeMode: "cover",
|
|
4265
4335
|
onError: () => setImageFailed(true),
|
|
4266
4336
|
accessible: false
|
|
@@ -4280,7 +4350,7 @@ function LinkPreviewCard({
|
|
|
4280
4350
|
accessibilityRole: "link",
|
|
4281
4351
|
accessibilityLabel: [site, preview.title].filter(Boolean).join(": ") || preview.url,
|
|
4282
4352
|
style: ({ pressed }) => [
|
|
4283
|
-
|
|
4353
|
+
styles20.card,
|
|
4284
4354
|
{
|
|
4285
4355
|
maxWidth,
|
|
4286
4356
|
borderRadius: theme.radii.md,
|
|
@@ -4295,7 +4365,7 @@ function LinkPreviewCard({
|
|
|
4295
4365
|
{
|
|
4296
4366
|
source: { uri: preview.image_url },
|
|
4297
4367
|
style: [
|
|
4298
|
-
|
|
4368
|
+
styles20.cardImage,
|
|
4299
4369
|
{ borderTopLeftRadius: theme.radii.md, borderTopRightRadius: theme.radii.md }
|
|
4300
4370
|
],
|
|
4301
4371
|
resizeMode: "cover",
|
|
@@ -4303,13 +4373,13 @@ function LinkPreviewCard({
|
|
|
4303
4373
|
accessible: false
|
|
4304
4374
|
}
|
|
4305
4375
|
) : null,
|
|
4306
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
4307
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4376
|
+
/* @__PURE__ */ jsxs(View, { style: [styles20.cardBody, { padding: theme.spacing.sm, gap: 2 }], children: [
|
|
4377
|
+
/* @__PURE__ */ jsxs(View, { style: styles20.siteLine, children: [
|
|
4308
4378
|
preview.favicon_url && !faviconFailed ? /* @__PURE__ */ jsx(
|
|
4309
4379
|
Image,
|
|
4310
4380
|
{
|
|
4311
4381
|
source: { uri: preview.favicon_url },
|
|
4312
|
-
style:
|
|
4382
|
+
style: styles20.favicon,
|
|
4313
4383
|
onError: () => setFaviconFailed(true),
|
|
4314
4384
|
accessible: false
|
|
4315
4385
|
}
|
|
@@ -4317,7 +4387,7 @@ function LinkPreviewCard({
|
|
|
4317
4387
|
/* @__PURE__ */ jsx(
|
|
4318
4388
|
Text,
|
|
4319
4389
|
{
|
|
4320
|
-
style: [
|
|
4390
|
+
style: [styles20.site, { color: muted, fontFamily: theme.fonts.body }],
|
|
4321
4391
|
numberOfLines: 1,
|
|
4322
4392
|
children: site
|
|
4323
4393
|
}
|
|
@@ -4327,7 +4397,7 @@ function LinkPreviewCard({
|
|
|
4327
4397
|
Text,
|
|
4328
4398
|
{
|
|
4329
4399
|
style: [
|
|
4330
|
-
|
|
4400
|
+
styles20.title,
|
|
4331
4401
|
{ color: onBrand ? text : theme.colors.link, fontFamily: theme.fonts.body }
|
|
4332
4402
|
],
|
|
4333
4403
|
numberOfLines: 2,
|
|
@@ -4337,7 +4407,7 @@ function LinkPreviewCard({
|
|
|
4337
4407
|
preview.description ? /* @__PURE__ */ jsx(
|
|
4338
4408
|
Text,
|
|
4339
4409
|
{
|
|
4340
|
-
style: [
|
|
4410
|
+
style: [styles20.description, { color: muted, fontFamily: theme.fonts.body }],
|
|
4341
4411
|
numberOfLines: 2,
|
|
4342
4412
|
children: preview.description
|
|
4343
4413
|
}
|
|
@@ -4352,7 +4422,7 @@ function hostOf(url) {
|
|
|
4352
4422
|
const m = /^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i.exec(url);
|
|
4353
4423
|
return (m?.[1] ?? url).replace(/^www\./, "");
|
|
4354
4424
|
}
|
|
4355
|
-
var
|
|
4425
|
+
var styles20 = StyleSheet.create({
|
|
4356
4426
|
card: {
|
|
4357
4427
|
alignSelf: "stretch",
|
|
4358
4428
|
borderLeftWidth: 3,
|
|
@@ -4478,16 +4548,16 @@ function MessageBubble({
|
|
|
4478
4548
|
View,
|
|
4479
4549
|
{
|
|
4480
4550
|
style: [
|
|
4481
|
-
|
|
4482
|
-
variant === "inline" &&
|
|
4483
|
-
variant === "inline" && dense &&
|
|
4484
|
-
variant === "wrapped" &&
|
|
4485
|
-
variant === "overlay" &&
|
|
4486
|
-
variant === "block" &&
|
|
4551
|
+
styles21.metaRow,
|
|
4552
|
+
variant === "inline" && styles21.metaInline,
|
|
4553
|
+
variant === "inline" && dense && styles21.metaInlineDense,
|
|
4554
|
+
variant === "wrapped" && styles21.metaWrapped,
|
|
4555
|
+
variant === "overlay" && styles21.metaOverlay,
|
|
4556
|
+
variant === "block" && styles21.metaBlock,
|
|
4487
4557
|
// File-only bubble: the meta row follows the cards directly —
|
|
4488
4558
|
// give it air so the time doesn't sit glued to the card.
|
|
4489
|
-
variant === "block" && hasFiles && !hasBody &&
|
|
4490
|
-
variant === "jumbo" &&
|
|
4559
|
+
variant === "block" && hasFiles && !hasBody && styles21.metaBlockAfterFiles,
|
|
4560
|
+
variant === "jumbo" && styles21.metaJumbo
|
|
4491
4561
|
],
|
|
4492
4562
|
onLayout: variant === "inline" || variant === "wrapped" ? (e) => setMetaWidth(e.nativeEvent.layout.width) : void 0,
|
|
4493
4563
|
pointerEvents: isEdited && onEditedPress ? "box-none" : "none",
|
|
@@ -4495,7 +4565,7 @@ function MessageBubble({
|
|
|
4495
4565
|
isEdited ? /* @__PURE__ */ jsx(
|
|
4496
4566
|
Text,
|
|
4497
4567
|
{
|
|
4498
|
-
style: [
|
|
4568
|
+
style: [styles21.editedTag, { color, opacity: 0.8 }],
|
|
4499
4569
|
...onEditedPress ? {
|
|
4500
4570
|
onPress: onEditedPress,
|
|
4501
4571
|
suppressHighlighting: true,
|
|
@@ -4506,8 +4576,8 @@ function MessageBubble({
|
|
|
4506
4576
|
children: "edited"
|
|
4507
4577
|
}
|
|
4508
4578
|
) : null,
|
|
4509
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
4510
|
-
isSelf && readState ? /* @__PURE__ */ jsx(View, { style:
|
|
4579
|
+
/* @__PURE__ */ jsx(Text, { style: [styles21.meta, { color, opacity: variant === "overlay" ? 1 : 0.75 }], children: time }),
|
|
4580
|
+
isSelf && readState ? /* @__PURE__ */ jsx(View, { style: styles21.readTick, children: /* @__PURE__ */ jsx(
|
|
4511
4581
|
PoolseIcon,
|
|
4512
4582
|
{
|
|
4513
4583
|
name: readState === "read" ? "check-double" : "check",
|
|
@@ -4523,7 +4593,7 @@ function MessageBubble({
|
|
|
4523
4593
|
View,
|
|
4524
4594
|
{
|
|
4525
4595
|
style: [
|
|
4526
|
-
|
|
4596
|
+
styles21.wrap,
|
|
4527
4597
|
{ alignSelf: isSelf ? "flex-end" : "flex-start", maxWidth: bubbleMaxWidth }
|
|
4528
4598
|
],
|
|
4529
4599
|
children: [
|
|
@@ -4549,7 +4619,7 @@ function MessageBubble({
|
|
|
4549
4619
|
showSenderName && !isSelf && jumboCount === 0 && (groupPosition === "first" || groupPosition === "standalone") ? /* @__PURE__ */ jsx(
|
|
4550
4620
|
Text,
|
|
4551
4621
|
{
|
|
4552
|
-
style: [
|
|
4622
|
+
style: [styles21.senderName, { color: senderTint, fontFamily: theme.fonts.body }],
|
|
4553
4623
|
...onSenderPress ? {
|
|
4554
4624
|
onPress: onSenderPress,
|
|
4555
4625
|
accessibilityRole: "button",
|
|
@@ -4576,7 +4646,7 @@ function MessageBubble({
|
|
|
4576
4646
|
// 3px of bubble color framing the picture; the mosaic clips
|
|
4577
4647
|
// itself 3px tighter than the bubble so the curves stay
|
|
4578
4648
|
// concentric.
|
|
4579
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4649
|
+
/* @__PURE__ */ jsxs(View, { style: styles21.mediaFrame, children: [
|
|
4580
4650
|
/* @__PURE__ */ jsx(
|
|
4581
4651
|
ImageMosaic,
|
|
4582
4652
|
{
|
|
@@ -4590,7 +4660,7 @@ function MessageBubble({
|
|
|
4590
4660
|
metaOverlay ? metaRow("overlay") : null
|
|
4591
4661
|
] })
|
|
4592
4662
|
) : null,
|
|
4593
|
-
hasFiles ? /* @__PURE__ */ jsx(View, { style:
|
|
4663
|
+
hasFiles ? /* @__PURE__ */ jsx(View, { style: styles21.filesBlock, children: files.map((att) => /* @__PURE__ */ jsx(
|
|
4594
4664
|
AttachmentPreview,
|
|
4595
4665
|
{
|
|
4596
4666
|
attachment: att,
|
|
@@ -4609,9 +4679,9 @@ function MessageBubble({
|
|
|
4609
4679
|
View,
|
|
4610
4680
|
{
|
|
4611
4681
|
style: [
|
|
4612
|
-
|
|
4613
|
-
dense &&
|
|
4614
|
-
sectionAbove &&
|
|
4682
|
+
styles21.textBlock,
|
|
4683
|
+
dense && styles21.textBlockDense,
|
|
4684
|
+
sectionAbove && styles21.textBlockAfter
|
|
4615
4685
|
],
|
|
4616
4686
|
children: /* @__PURE__ */ jsx(
|
|
4617
4687
|
Text,
|
|
@@ -4629,7 +4699,7 @@ function MessageBubble({
|
|
|
4629
4699
|
)
|
|
4630
4700
|
}
|
|
4631
4701
|
) : null,
|
|
4632
|
-
hasBody && jumboCount > 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
4702
|
+
hasBody && jumboCount > 0 ? /* @__PURE__ */ jsx(View, { style: styles21.jumboBlock, children: /* @__PURE__ */ jsx(
|
|
4633
4703
|
Text,
|
|
4634
4704
|
{
|
|
4635
4705
|
style: {
|
|
@@ -4643,9 +4713,9 @@ function MessageBubble({
|
|
|
4643
4713
|
View,
|
|
4644
4714
|
{
|
|
4645
4715
|
style: [
|
|
4646
|
-
|
|
4647
|
-
dense &&
|
|
4648
|
-
sectionAbove &&
|
|
4716
|
+
styles21.textBlock,
|
|
4717
|
+
dense && styles21.textBlockDense,
|
|
4718
|
+
sectionAbove && styles21.textBlockAfter
|
|
4649
4719
|
],
|
|
4650
4720
|
onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
|
|
4651
4721
|
children: [
|
|
@@ -4680,7 +4750,7 @@ function MessageBubble({
|
|
|
4680
4750
|
Text,
|
|
4681
4751
|
{
|
|
4682
4752
|
style: [
|
|
4683
|
-
|
|
4753
|
+
styles21.readMore,
|
|
4684
4754
|
{ color: isSelf ? theme.colors.ownBubbleText : theme.colors.link }
|
|
4685
4755
|
],
|
|
4686
4756
|
children: expanded ? "Show less" : "Read more"
|
|
@@ -4695,7 +4765,7 @@ function MessageBubble({
|
|
|
4695
4765
|
hasPreviews ? (
|
|
4696
4766
|
// A fixed width, like media: a card squeezed into the width of
|
|
4697
4767
|
// a one-word message would be unreadable.
|
|
4698
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
4768
|
+
/* @__PURE__ */ jsx(View, { style: [styles21.previews, !hasBody && styles21.previewsAlone, { width: mediaWidth }], children: previews.map((p) => /* @__PURE__ */ jsx(
|
|
4699
4769
|
LinkPreviewCard,
|
|
4700
4770
|
{
|
|
4701
4771
|
preview: p,
|
|
@@ -4707,7 +4777,7 @@ function MessageBubble({
|
|
|
4707
4777
|
)) })
|
|
4708
4778
|
) : null,
|
|
4709
4779
|
!inlineMeta && !metaOverlay && jumboCount === 0 ? metaRow("block") : null,
|
|
4710
|
-
actionsTrigger ? /* @__PURE__ */ jsx(View, { style:
|
|
4780
|
+
actionsTrigger ? /* @__PURE__ */ jsx(View, { style: styles21.actionsSlot, children: actionsTrigger }) : null
|
|
4711
4781
|
]
|
|
4712
4782
|
}
|
|
4713
4783
|
),
|
|
@@ -4734,15 +4804,15 @@ function QuotedCard({
|
|
|
4734
4804
|
onPress,
|
|
4735
4805
|
disabled: !onPress,
|
|
4736
4806
|
style: [
|
|
4737
|
-
|
|
4807
|
+
styles21.quoted,
|
|
4738
4808
|
{
|
|
4739
4809
|
backgroundColor: bg,
|
|
4740
4810
|
borderLeftColor: accent
|
|
4741
4811
|
}
|
|
4742
4812
|
],
|
|
4743
4813
|
children: [
|
|
4744
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
4745
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
4814
|
+
/* @__PURE__ */ jsx(Text, { style: [styles21.quotedSender, { color: accent }], numberOfLines: 1, children: senderName }),
|
|
4815
|
+
/* @__PURE__ */ jsx(Text, { style: [styles21.quotedBody, { color: txt }], numberOfLines: 2, children: quoted.deleted_at ? "Original message deleted" : quoted.body ?? "\u2026" })
|
|
4746
4816
|
]
|
|
4747
4817
|
}
|
|
4748
4818
|
);
|
|
@@ -4775,7 +4845,7 @@ function formatTime2(iso, format2) {
|
|
|
4775
4845
|
function isSameDay(a, b) {
|
|
4776
4846
|
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
4777
4847
|
}
|
|
4778
|
-
var
|
|
4848
|
+
var styles21 = StyleSheet.create({
|
|
4779
4849
|
wrap: {
|
|
4780
4850
|
marginBottom: 2
|
|
4781
4851
|
},
|
|
@@ -4902,6 +4972,24 @@ var styles20 = StyleSheet.create({
|
|
|
4902
4972
|
opacity: 0.8
|
|
4903
4973
|
}
|
|
4904
4974
|
});
|
|
4975
|
+
|
|
4976
|
+
// src/internal/a11y.ts
|
|
4977
|
+
function messageA11yLabel(msg, senderName, isSelf) {
|
|
4978
|
+
const who = isSelf ? "You" : senderName;
|
|
4979
|
+
if (msg.deleted_at) return `${who}: message deleted`;
|
|
4980
|
+
const parts = [];
|
|
4981
|
+
const body = (msg.body ?? "").trim();
|
|
4982
|
+
if (body) parts.push(body.length > 300 ? `${body.slice(0, 300)}\u2026` : body);
|
|
4983
|
+
const files = Array.isArray(msg.attachments) ? msg.attachments.length : 0;
|
|
4984
|
+
if (files > 0) parts.push(files === 1 ? "1 attachment" : `${files} attachments`);
|
|
4985
|
+
if (msg.edited_at) parts.push("edited");
|
|
4986
|
+
if (msg.local_status === "queued") parts.push("waiting for network");
|
|
4987
|
+
if (msg.local_status === "failed") parts.push("not sent");
|
|
4988
|
+
return `${who}: ${parts.join(", ") || "message"}`;
|
|
4989
|
+
}
|
|
4990
|
+
function reactionA11yLabel(emoji, count, mine) {
|
|
4991
|
+
return `${emoji} ${count}${mine ? ", you reacted" : ""}`;
|
|
4992
|
+
}
|
|
4905
4993
|
var DEFAULT_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F64F}", "\u{1F525}"];
|
|
4906
4994
|
function ReactionStrip({
|
|
4907
4995
|
messageId,
|
|
@@ -4918,7 +5006,7 @@ function ReactionStrip({
|
|
|
4918
5006
|
});
|
|
4919
5007
|
const entries = Object.entries(reactions);
|
|
4920
5008
|
if (entries.length === 0) return null;
|
|
4921
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
5009
|
+
return /* @__PURE__ */ jsxs(View, { style: styles22.strip, children: [
|
|
4922
5010
|
entries.map(([emoji, userIds]) => {
|
|
4923
5011
|
const userArr = Array.isArray(userIds) ? userIds : [];
|
|
4924
5012
|
const meReacted = meId !== null && userArr.includes(meId);
|
|
@@ -4926,8 +5014,12 @@ function ReactionStrip({
|
|
|
4926
5014
|
Pressable,
|
|
4927
5015
|
{
|
|
4928
5016
|
onPress: () => meReacted ? removeReaction(emoji) : addReaction(emoji),
|
|
5017
|
+
accessibilityRole: "button",
|
|
5018
|
+
accessibilityLabel: reactionA11yLabel(emoji, userArr.length, meReacted),
|
|
5019
|
+
accessibilityState: { selected: meReacted },
|
|
5020
|
+
accessibilityHint: meReacted ? "Removes your reaction" : "Adds this reaction",
|
|
4929
5021
|
style: [
|
|
4930
|
-
|
|
5022
|
+
styles22.chip,
|
|
4931
5023
|
{
|
|
4932
5024
|
backgroundColor: meReacted ? theme.colors.accentSoft : theme.colors.surfaceAlt,
|
|
4933
5025
|
borderColor: meReacted ? theme.colors.accent : theme.colors.border,
|
|
@@ -4936,12 +5028,12 @@ function ReactionStrip({
|
|
|
4936
5028
|
}
|
|
4937
5029
|
],
|
|
4938
5030
|
children: [
|
|
4939
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
5031
|
+
/* @__PURE__ */ jsx(Text, { style: styles22.emoji, children: emoji }),
|
|
4940
5032
|
/* @__PURE__ */ jsx(
|
|
4941
5033
|
Text,
|
|
4942
5034
|
{
|
|
4943
5035
|
style: [
|
|
4944
|
-
|
|
5036
|
+
styles22.count,
|
|
4945
5037
|
{
|
|
4946
5038
|
color: meReacted ? theme.colors.accent : theme.colors.textMuted,
|
|
4947
5039
|
fontWeight: meReacted ? "700" : "600"
|
|
@@ -4961,7 +5053,7 @@ function ReactionStrip({
|
|
|
4961
5053
|
onPress: onMorePress,
|
|
4962
5054
|
hitSlop: 4,
|
|
4963
5055
|
style: [
|
|
4964
|
-
|
|
5056
|
+
styles22.chip,
|
|
4965
5057
|
{
|
|
4966
5058
|
backgroundColor: theme.colors.surfaceAlt,
|
|
4967
5059
|
borderColor: theme.colors.border,
|
|
@@ -4994,13 +5086,13 @@ function ReactionPicker({
|
|
|
4994
5086
|
children: /* @__PURE__ */ jsx(
|
|
4995
5087
|
Pressable,
|
|
4996
5088
|
{
|
|
4997
|
-
style: [
|
|
5089
|
+
style: [styles22.backdrop, { paddingTop: insets.top, paddingBottom: insets.bottom }],
|
|
4998
5090
|
onPress: onClose,
|
|
4999
5091
|
children: /* @__PURE__ */ jsx(
|
|
5000
5092
|
View,
|
|
5001
5093
|
{
|
|
5002
5094
|
style: [
|
|
5003
|
-
|
|
5095
|
+
styles22.sheet,
|
|
5004
5096
|
{
|
|
5005
5097
|
backgroundColor: theme.colors.surface,
|
|
5006
5098
|
borderRadius: theme.radii.lg
|
|
@@ -5010,12 +5102,12 @@ function ReactionPicker({
|
|
|
5010
5102
|
children: emojis.map((emoji) => /* @__PURE__ */ jsx(
|
|
5011
5103
|
Pressable,
|
|
5012
5104
|
{
|
|
5013
|
-
style:
|
|
5105
|
+
style: styles22.emojiBtn,
|
|
5014
5106
|
onPress: () => {
|
|
5015
5107
|
onPick(emoji);
|
|
5016
5108
|
onClose();
|
|
5017
5109
|
},
|
|
5018
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
5110
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles22.bigEmoji, children: emoji })
|
|
5019
5111
|
},
|
|
5020
5112
|
emoji
|
|
5021
5113
|
))
|
|
@@ -5026,7 +5118,7 @@ function ReactionPicker({
|
|
|
5026
5118
|
}
|
|
5027
5119
|
);
|
|
5028
5120
|
}
|
|
5029
|
-
var
|
|
5121
|
+
var styles22 = StyleSheet.create({
|
|
5030
5122
|
strip: {
|
|
5031
5123
|
flexDirection: "row",
|
|
5032
5124
|
flexWrap: "wrap",
|
|
@@ -5082,6 +5174,69 @@ var styles21 = StyleSheet.create({
|
|
|
5082
5174
|
lineHeight: 38
|
|
5083
5175
|
}
|
|
5084
5176
|
});
|
|
5177
|
+
function SendStatus({ message, onRetry, onDiscard, alignEnd = true }) {
|
|
5178
|
+
const theme = useTheme();
|
|
5179
|
+
const status = message.local_status;
|
|
5180
|
+
if (status !== "queued" && status !== "failed") return null;
|
|
5181
|
+
const failed = status === "failed";
|
|
5182
|
+
const text = failed ? message.local_error ? `Not sent: ${message.local_error}` : "Not sent" : "Waiting for network\u2026";
|
|
5183
|
+
const button = (label, onPress, danger = false) => /* @__PURE__ */ jsx(
|
|
5184
|
+
Pressable,
|
|
5185
|
+
{
|
|
5186
|
+
onPress,
|
|
5187
|
+
accessibilityRole: "button",
|
|
5188
|
+
accessibilityLabel: `${label} message`,
|
|
5189
|
+
hitSlop: 8,
|
|
5190
|
+
style: styles23.button,
|
|
5191
|
+
children: /* @__PURE__ */ jsx(
|
|
5192
|
+
Text,
|
|
5193
|
+
{
|
|
5194
|
+
style: [
|
|
5195
|
+
styles23.buttonText,
|
|
5196
|
+
{ color: danger ? theme.colors.danger : theme.colors.accentStrong },
|
|
5197
|
+
{ fontFamily: theme.fonts.body }
|
|
5198
|
+
],
|
|
5199
|
+
children: label
|
|
5200
|
+
}
|
|
5201
|
+
)
|
|
5202
|
+
}
|
|
5203
|
+
);
|
|
5204
|
+
return /* @__PURE__ */ jsxs(
|
|
5205
|
+
View,
|
|
5206
|
+
{
|
|
5207
|
+
style: [styles23.root, { justifyContent: alignEnd ? "flex-end" : "flex-start" }],
|
|
5208
|
+
accessibilityLiveRegion: "polite",
|
|
5209
|
+
children: [
|
|
5210
|
+
/* @__PURE__ */ jsx(
|
|
5211
|
+
Text,
|
|
5212
|
+
{
|
|
5213
|
+
style: [
|
|
5214
|
+
styles23.text,
|
|
5215
|
+
{ color: failed ? theme.colors.danger : theme.colors.textMuted },
|
|
5216
|
+
{ fontFamily: theme.fonts.body }
|
|
5217
|
+
],
|
|
5218
|
+
children: text
|
|
5219
|
+
}
|
|
5220
|
+
),
|
|
5221
|
+
onRetry ? button(failed ? "Retry" : "Send now", onRetry) : null,
|
|
5222
|
+
failed && onDiscard ? button("Delete", onDiscard, true) : null
|
|
5223
|
+
]
|
|
5224
|
+
}
|
|
5225
|
+
);
|
|
5226
|
+
}
|
|
5227
|
+
var styles23 = StyleSheet.create({
|
|
5228
|
+
root: {
|
|
5229
|
+
flexDirection: "row",
|
|
5230
|
+
flexWrap: "wrap",
|
|
5231
|
+
alignItems: "center",
|
|
5232
|
+
gap: 10,
|
|
5233
|
+
marginTop: 2,
|
|
5234
|
+
marginBottom: 4
|
|
5235
|
+
},
|
|
5236
|
+
text: { fontSize: 12, flexShrink: 1 },
|
|
5237
|
+
button: { paddingVertical: 2 },
|
|
5238
|
+
buttonText: { fontSize: 12, fontWeight: "700" }
|
|
5239
|
+
});
|
|
5085
5240
|
|
|
5086
5241
|
// src/internal/thread.ts
|
|
5087
5242
|
function threadSummaryText(replyCount, lastReplyAt, now = Date.now()) {
|
|
@@ -5122,7 +5277,7 @@ function ThreadSummary({
|
|
|
5122
5277
|
accessibilityLabel: `${label}. Open thread`,
|
|
5123
5278
|
hitSlop: 4,
|
|
5124
5279
|
style: ({ pressed }) => [
|
|
5125
|
-
|
|
5280
|
+
styles24.row,
|
|
5126
5281
|
{
|
|
5127
5282
|
alignSelf: alignEnd ? "flex-end" : "flex-start",
|
|
5128
5283
|
borderRadius: theme.radii.pill,
|
|
@@ -5130,11 +5285,11 @@ function ThreadSummary({
|
|
|
5130
5285
|
}
|
|
5131
5286
|
],
|
|
5132
5287
|
children: [
|
|
5133
|
-
people.length > 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
5288
|
+
people.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles24.stack, children: people.map((p, i) => /* @__PURE__ */ jsx(
|
|
5134
5289
|
View,
|
|
5135
5290
|
{
|
|
5136
5291
|
style: [
|
|
5137
|
-
|
|
5292
|
+
styles24.stacked,
|
|
5138
5293
|
{
|
|
5139
5294
|
marginLeft: i === 0 ? 0 : -6,
|
|
5140
5295
|
borderColor: theme.colors.background,
|
|
@@ -5156,7 +5311,7 @@ function ThreadSummary({
|
|
|
5156
5311
|
/* @__PURE__ */ jsx(
|
|
5157
5312
|
Text,
|
|
5158
5313
|
{
|
|
5159
|
-
style: [
|
|
5314
|
+
style: [styles24.text, { color: theme.colors.link, fontFamily: theme.fonts.body }],
|
|
5160
5315
|
numberOfLines: 1,
|
|
5161
5316
|
children: label
|
|
5162
5317
|
}
|
|
@@ -5176,7 +5331,7 @@ function Participant({
|
|
|
5176
5331
|
const src = externalId ? avatarFor?.(externalId) ?? resolved.profile?.avatarUrl ?? null : null;
|
|
5177
5332
|
return /* @__PURE__ */ jsx(Avatar, { src, name, seed: externalId ?? fallback, size: "xs" });
|
|
5178
5333
|
}
|
|
5179
|
-
var
|
|
5334
|
+
var styles24 = StyleSheet.create({
|
|
5180
5335
|
row: {
|
|
5181
5336
|
flexDirection: "row",
|
|
5182
5337
|
alignItems: "center",
|
|
@@ -5231,7 +5386,9 @@ function FlatMessageRow({
|
|
|
5231
5386
|
linkPreviews = true,
|
|
5232
5387
|
onRemoveLinkPreview,
|
|
5233
5388
|
onMarkUnread,
|
|
5234
|
-
editHistory = true
|
|
5389
|
+
editHistory = true,
|
|
5390
|
+
onRetrySend,
|
|
5391
|
+
onDiscardSend
|
|
5235
5392
|
}) {
|
|
5236
5393
|
const theme = useTheme();
|
|
5237
5394
|
const { width: screenWidth } = useWindowDimensions();
|
|
@@ -5260,9 +5417,10 @@ function FlatMessageRow({
|
|
|
5260
5417
|
const isRunStart = compact || groupPosition === "first" || groupPosition === "standalone";
|
|
5261
5418
|
const ctx = { message: msg, isSelf, sender, layout, isRunStart };
|
|
5262
5419
|
const deleted = isTombstone(msg);
|
|
5420
|
+
const inert = deleted || !!msg.local_status;
|
|
5263
5421
|
const time = formatMessageTime(msg.inserted_at, timeFormat);
|
|
5264
5422
|
const openActions = () => {
|
|
5265
|
-
if (actions && !
|
|
5423
|
+
if (actions && !inert) setActionsOpen(true);
|
|
5266
5424
|
};
|
|
5267
5425
|
const text = { fontFamily: theme.fonts.body, color: theme.colors.text };
|
|
5268
5426
|
const avatarEl = showAvatar ? /* @__PURE__ */ jsx(
|
|
@@ -5289,10 +5447,10 @@ function FlatMessageRow({
|
|
|
5289
5447
|
Text,
|
|
5290
5448
|
{
|
|
5291
5449
|
style: [
|
|
5292
|
-
|
|
5450
|
+
styles25.name,
|
|
5293
5451
|
text,
|
|
5294
5452
|
compact ? { color: userColor(ext ?? msg.sender_id ?? msg.id) } : null,
|
|
5295
|
-
compact ?
|
|
5453
|
+
compact ? styles25.nameCompact : null
|
|
5296
5454
|
],
|
|
5297
5455
|
numberOfLines: 1,
|
|
5298
5456
|
...onSenderPress && !isSelf ? {
|
|
@@ -5307,22 +5465,22 @@ function FlatMessageRow({
|
|
|
5307
5465
|
Text,
|
|
5308
5466
|
{
|
|
5309
5467
|
style: [
|
|
5310
|
-
|
|
5468
|
+
styles25.time,
|
|
5311
5469
|
{ color: theme.colors.textSubtle, fontFamily: theme.fonts.body },
|
|
5312
|
-
dim ?
|
|
5470
|
+
dim ? styles25.timeDim : null
|
|
5313
5471
|
],
|
|
5314
5472
|
...dim ? { numberOfLines: 1, adjustsFontSizeToFit: true, minimumFontScale: 0.6 } : {},
|
|
5315
5473
|
children: dim ? gutterTime(time) : time
|
|
5316
5474
|
}
|
|
5317
5475
|
);
|
|
5318
|
-
const header = compact ? name : isRunStart ? /* @__PURE__ */ jsxs(View, { style:
|
|
5476
|
+
const header = compact ? name : isRunStart ? /* @__PURE__ */ jsxs(View, { style: styles25.header, children: [
|
|
5319
5477
|
name,
|
|
5320
5478
|
timeText(false)
|
|
5321
5479
|
] }) : null;
|
|
5322
5480
|
const images = attachments && !deleted ? (msg.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
|
|
5323
5481
|
const files = attachments && !deleted ? (msg.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
|
|
5324
5482
|
const mediaWidth = Math.min(screenWidth - GUTTER - 48, 320);
|
|
5325
|
-
const attachmentsEl = images.length > 0 || files.length > 0 ? /* @__PURE__ */ jsxs(View, { style:
|
|
5483
|
+
const attachmentsEl = images.length > 0 || files.length > 0 ? /* @__PURE__ */ jsxs(View, { style: styles25.attachments, children: [
|
|
5326
5484
|
images.length > 0 ? /* @__PURE__ */ jsx(
|
|
5327
5485
|
ImageMosaic,
|
|
5328
5486
|
{
|
|
@@ -5345,11 +5503,11 @@ function FlatMessageRow({
|
|
|
5345
5503
|
lineHeight: dense ? theme.fonts.lineHeight - 3 : theme.fonts.lineHeight
|
|
5346
5504
|
};
|
|
5347
5505
|
const edited = !!msg.edited_at && !deleted;
|
|
5348
|
-
const meta = edited || isSelf && readState ? /* @__PURE__ */ jsxs(View, { style:
|
|
5506
|
+
const meta = edited || isSelf && readState ? /* @__PURE__ */ jsxs(View, { style: styles25.meta, children: [
|
|
5349
5507
|
edited ? /* @__PURE__ */ jsx(
|
|
5350
5508
|
Text,
|
|
5351
5509
|
{
|
|
5352
|
-
style: [
|
|
5510
|
+
style: [styles25.edited, { color: theme.colors.textSubtle }],
|
|
5353
5511
|
...editHistory && canShowEditHistory(msg.id) ? {
|
|
5354
5512
|
onPress: () => setHistoryOpen(true),
|
|
5355
5513
|
suppressHighlighting: true,
|
|
@@ -5369,7 +5527,7 @@ function FlatMessageRow({
|
|
|
5369
5527
|
}
|
|
5370
5528
|
) : null
|
|
5371
5529
|
] }) : null;
|
|
5372
|
-
const body = deleted ? /* @__PURE__ */ jsx(Text, { style: [bodyText,
|
|
5530
|
+
const body = deleted ? /* @__PURE__ */ jsx(Text, { style: [bodyText, styles25.deleted, { color: theme.colors.textMuted }], children: "This message was deleted" }) : raw ? /* @__PURE__ */ jsxs(View, { children: [
|
|
5373
5531
|
jumbo > 0 ? /* @__PURE__ */ jsx(Text, { style: { fontSize: emojiFontSize(jumbo), lineHeight: emojiFontSize(jumbo) + 8 }, children: raw }) : markdown && hasMarkdown(shown) ? renderMarkdown(shown, {
|
|
5374
5532
|
textColor: bodyText.color,
|
|
5375
5533
|
linkColor: theme.colors.link,
|
|
@@ -5381,8 +5539,8 @@ function FlatMessageRow({
|
|
|
5381
5539
|
return false;
|
|
5382
5540
|
}
|
|
5383
5541
|
}) : /* @__PURE__ */ jsx(Text, { style: bodyText, children: shown }),
|
|
5384
|
-
trimmable ? /* @__PURE__ */ jsx(Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsx(Text, { style: [
|
|
5385
|
-
previews.length > 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
5542
|
+
trimmable ? /* @__PURE__ */ jsx(Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsx(Text, { style: [styles25.readMore, { color: theme.colors.link }], children: expanded ? "Show less" : "Read more" }) }) : null,
|
|
5543
|
+
previews.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles25.previews, children: previews.map((p) => /* @__PURE__ */ jsx(
|
|
5386
5544
|
LinkPreviewCard,
|
|
5387
5545
|
{
|
|
5388
5546
|
preview: p,
|
|
@@ -5406,7 +5564,7 @@ function FlatMessageRow({
|
|
|
5406
5564
|
}
|
|
5407
5565
|
) : null
|
|
5408
5566
|
);
|
|
5409
|
-
const reactionsEl = reactions && !
|
|
5567
|
+
const reactionsEl = reactions && !inert ? /* @__PURE__ */ jsx(View, { style: styles25.reactions, children: /* @__PURE__ */ jsx(
|
|
5410
5568
|
ReactionStrip,
|
|
5411
5569
|
{
|
|
5412
5570
|
messageId: msg.id,
|
|
@@ -5425,15 +5583,24 @@ function FlatMessageRow({
|
|
|
5425
5583
|
...onQuotedClick ? { onPress: () => onQuotedClick(msg.quoted_message.id) } : {}
|
|
5426
5584
|
}
|
|
5427
5585
|
) : null;
|
|
5428
|
-
const content = /* @__PURE__ */ jsxs(View, { style:
|
|
5586
|
+
const content = /* @__PURE__ */ jsxs(View, { style: styles25.content, children: [
|
|
5429
5587
|
!compact ? renderSlot(slots?.header, ctx, header) : null,
|
|
5430
5588
|
quote,
|
|
5431
5589
|
renderSlot(slots?.attachments, ctx, attachmentsEl),
|
|
5432
5590
|
renderSlot(slots?.body, ctx, body),
|
|
5433
5591
|
renderSlot(slots?.reactions, ctx, reactionsEl),
|
|
5434
|
-
renderSlot(slots?.thread, ctx, threadEl)
|
|
5592
|
+
renderSlot(slots?.thread, ctx, threadEl),
|
|
5593
|
+
/* @__PURE__ */ jsx(
|
|
5594
|
+
SendStatus,
|
|
5595
|
+
{
|
|
5596
|
+
message: msg,
|
|
5597
|
+
alignEnd: false,
|
|
5598
|
+
...onRetrySend ? { onRetry: onRetrySend } : {},
|
|
5599
|
+
...onDiscardSend ? { onDiscard: onDiscardSend } : {}
|
|
5600
|
+
}
|
|
5601
|
+
)
|
|
5435
5602
|
] });
|
|
5436
|
-
const sheet = actions && actionsOpen && !
|
|
5603
|
+
const sheet = actions && actionsOpen && !inert ? /* @__PURE__ */ jsx(
|
|
5437
5604
|
RowActionsSheet,
|
|
5438
5605
|
{
|
|
5439
5606
|
msg,
|
|
@@ -5457,28 +5624,32 @@ function FlatMessageRow({
|
|
|
5457
5624
|
View,
|
|
5458
5625
|
{
|
|
5459
5626
|
style: [
|
|
5460
|
-
|
|
5461
|
-
compact ?
|
|
5462
|
-
dense ?
|
|
5463
|
-
!compact && isRunStart ? dense ?
|
|
5627
|
+
styles25.row,
|
|
5628
|
+
compact ? styles25.rowCompact : null,
|
|
5629
|
+
dense ? styles25.rowDense : null,
|
|
5630
|
+
!compact && isRunStart ? dense ? styles25.runStartDense : styles25.runStart : null,
|
|
5464
5631
|
mentionsMe ? { backgroundColor: theme.colors.mention, borderLeftColor: theme.colors.accent } : null,
|
|
5465
|
-
isEditing ?
|
|
5632
|
+
isEditing ? styles25.rowEditing : null
|
|
5466
5633
|
],
|
|
5467
5634
|
children: [
|
|
5468
5635
|
/* @__PURE__ */ jsx(
|
|
5469
5636
|
Pressable,
|
|
5470
5637
|
{
|
|
5471
5638
|
onLongPress: openActions,
|
|
5472
|
-
style: [
|
|
5473
|
-
|
|
5474
|
-
|
|
5639
|
+
style: [styles25.line, compact ? styles25.lineCompact : null],
|
|
5640
|
+
accessibilityLabel: messageA11yLabel(msg, senderName, isSelf),
|
|
5641
|
+
...actions && !inert ? {
|
|
5642
|
+
accessibilityHint: "Long press for message actions",
|
|
5643
|
+
accessibilityActions: [{ name: "longpress", label: "Message actions" }],
|
|
5644
|
+
onAccessibilityAction: openActions
|
|
5645
|
+
} : {},
|
|
5475
5646
|
children: compact ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5476
5647
|
timeText(false),
|
|
5477
|
-
avatar ? /* @__PURE__ */ jsx(View, { style:
|
|
5648
|
+
avatar ? /* @__PURE__ */ jsx(View, { style: styles25.avatarCompact, children: avatar }) : null,
|
|
5478
5649
|
renderSlot(slots?.header, ctx, header),
|
|
5479
5650
|
content
|
|
5480
5651
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5481
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
5652
|
+
/* @__PURE__ */ jsx(View, { style: styles25.gutter, children: isRunStart ? avatar : timeText(true) }),
|
|
5482
5653
|
content
|
|
5483
5654
|
] })
|
|
5484
5655
|
}
|
|
@@ -5499,7 +5670,7 @@ function FlatMessageRow({
|
|
|
5499
5670
|
}
|
|
5500
5671
|
);
|
|
5501
5672
|
}
|
|
5502
|
-
var
|
|
5673
|
+
var styles25 = StyleSheet.create({
|
|
5503
5674
|
row: {
|
|
5504
5675
|
// 3px left border reserved for the mention accent bar.
|
|
5505
5676
|
borderLeftWidth: 3,
|
|
@@ -5651,13 +5822,13 @@ function MessageActions({
|
|
|
5651
5822
|
animationType: "fade",
|
|
5652
5823
|
onRequestClose: onClose,
|
|
5653
5824
|
...EDGE_TO_EDGE_MODAL,
|
|
5654
|
-
children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
5825
|
+
children: /* @__PURE__ */ jsx(Pressable, { style: styles26.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs(
|
|
5655
5826
|
Pressable,
|
|
5656
5827
|
{
|
|
5657
5828
|
onPress: () => void 0,
|
|
5658
5829
|
accessible: false,
|
|
5659
5830
|
style: [
|
|
5660
|
-
|
|
5831
|
+
styles26.sheet,
|
|
5661
5832
|
{
|
|
5662
5833
|
backgroundColor: theme.colors.surface,
|
|
5663
5834
|
borderTopLeftRadius: theme.radii.lg,
|
|
@@ -5670,7 +5841,7 @@ function MessageActions({
|
|
|
5670
5841
|
theme.shadows.lg
|
|
5671
5842
|
],
|
|
5672
5843
|
children: [
|
|
5673
|
-
showEmojiRow ? /* @__PURE__ */ jsxs(View, { style: [
|
|
5844
|
+
showEmojiRow ? /* @__PURE__ */ jsxs(View, { style: [styles26.emojiRow, { borderBottomColor: theme.colors.border }], children: [
|
|
5674
5845
|
emojis.map((emoji) => /* @__PURE__ */ jsx(
|
|
5675
5846
|
Pressable,
|
|
5676
5847
|
{
|
|
@@ -5678,10 +5849,10 @@ function MessageActions({
|
|
|
5678
5849
|
onPickReaction(emoji);
|
|
5679
5850
|
onClose();
|
|
5680
5851
|
},
|
|
5681
|
-
style:
|
|
5852
|
+
style: styles26.emojiBtn,
|
|
5682
5853
|
hitSlop: 6,
|
|
5683
5854
|
accessibilityLabel: `React with ${emoji}`,
|
|
5684
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
5855
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles26.emoji, children: emoji })
|
|
5685
5856
|
},
|
|
5686
5857
|
emoji
|
|
5687
5858
|
)),
|
|
@@ -5692,7 +5863,7 @@ function MessageActions({
|
|
|
5692
5863
|
onClose();
|
|
5693
5864
|
onMoreReactions();
|
|
5694
5865
|
},
|
|
5695
|
-
style: [
|
|
5866
|
+
style: [styles26.moreBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
5696
5867
|
hitSlop: 6,
|
|
5697
5868
|
accessibilityRole: "button",
|
|
5698
5869
|
accessibilityLabel: "More reactions",
|
|
@@ -5700,7 +5871,7 @@ function MessageActions({
|
|
|
5700
5871
|
}
|
|
5701
5872
|
) : null
|
|
5702
5873
|
] }) : null,
|
|
5703
|
-
items.map((item) => /* @__PURE__ */ jsxs(Pressable, { onPress: item.onPress, style:
|
|
5874
|
+
items.map((item) => /* @__PURE__ */ jsxs(Pressable, { onPress: item.onPress, style: styles26.item, children: [
|
|
5704
5875
|
/* @__PURE__ */ jsx(
|
|
5705
5876
|
PoolseIcon,
|
|
5706
5877
|
{
|
|
@@ -5713,7 +5884,7 @@ function MessageActions({
|
|
|
5713
5884
|
Text,
|
|
5714
5885
|
{
|
|
5715
5886
|
style: [
|
|
5716
|
-
|
|
5887
|
+
styles26.itemText,
|
|
5717
5888
|
{
|
|
5718
5889
|
color: item.danger ? theme.colors.danger : theme.colors.text,
|
|
5719
5890
|
fontFamily: theme.fonts.body
|
|
@@ -5733,7 +5904,7 @@ function hostOf2(url) {
|
|
|
5733
5904
|
const m = /^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i.exec(url);
|
|
5734
5905
|
return (m?.[1] ?? url).replace(/^www\./, "");
|
|
5735
5906
|
}
|
|
5736
|
-
var
|
|
5907
|
+
var styles26 = StyleSheet.create({
|
|
5737
5908
|
backdrop: {
|
|
5738
5909
|
flex: 1,
|
|
5739
5910
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
@@ -5897,11 +6068,13 @@ function BubbleMessageRow({
|
|
|
5897
6068
|
linkPreviews = true,
|
|
5898
6069
|
onRemoveLinkPreview,
|
|
5899
6070
|
onMarkUnread,
|
|
5900
|
-
editHistory = true
|
|
6071
|
+
editHistory = true,
|
|
6072
|
+
onRetrySend,
|
|
6073
|
+
onDiscardSend
|
|
5901
6074
|
}) {
|
|
5902
6075
|
const theme = useTheme();
|
|
5903
6076
|
const isSelf = meId !== null && msg.sender_id === meId;
|
|
5904
|
-
const tombstone = isTombstone(msg);
|
|
6077
|
+
const tombstone = isTombstone(msg) || !!msg.local_status;
|
|
5905
6078
|
const [actionsOpen, setActionsOpen] = useState(false);
|
|
5906
6079
|
const [emojiOpen, setEmojiOpen] = useState(false);
|
|
5907
6080
|
const [historyOpen, setHistoryOpen] = useState(false);
|
|
@@ -5983,8 +6156,7 @@ function BubbleMessageRow({
|
|
|
5983
6156
|
});
|
|
5984
6157
|
const showAvatarSlot = showAvatar && !isSelf;
|
|
5985
6158
|
const showAvatarRender = showAvatarSlot && (groupPosition === "last" || groupPosition === "standalone");
|
|
5986
|
-
const
|
|
5987
|
-
const rowSender = useUser(wantsSender ? msg.sender_external_id : null);
|
|
6159
|
+
const rowSender = useUser(msg.sender_external_id);
|
|
5988
6160
|
const avatarUrl = msg.sender_external_id ? avatarFor?.(msg.sender_external_id) ?? rowSender.profile?.avatarUrl ?? null : null;
|
|
5989
6161
|
const senderLabel = msg.sender_external_id ? labelFor?.(msg.sender_external_id) ?? rowSender.profile?.displayName ?? msg.sender_external_id : null;
|
|
5990
6162
|
const sender = {
|
|
@@ -6014,16 +6186,16 @@ function BubbleMessageRow({
|
|
|
6014
6186
|
View,
|
|
6015
6187
|
{
|
|
6016
6188
|
style: [
|
|
6017
|
-
|
|
6189
|
+
styles27.row,
|
|
6018
6190
|
{ alignSelf: isSelf ? "flex-end" : "flex-start" },
|
|
6019
|
-
density === "compact" ?
|
|
6191
|
+
density === "compact" ? styles27.rowDense : null,
|
|
6020
6192
|
// Lift this row above the dim backdrop the parent renders
|
|
6021
6193
|
// during edit mode. zIndex covers iOS / web; elevation does
|
|
6022
6194
|
// the equivalent on Android.
|
|
6023
|
-
isEditing ?
|
|
6195
|
+
isEditing ? styles27.rowEditing : null
|
|
6024
6196
|
],
|
|
6025
6197
|
children: [
|
|
6026
|
-
showAvatarSlot ? /* @__PURE__ */ jsx(View, { style:
|
|
6198
|
+
showAvatarSlot ? /* @__PURE__ */ jsx(View, { style: styles27.avatarSlot, children: !showAvatarRender ? null : onAvatarPress ? /* @__PURE__ */ jsx(
|
|
6027
6199
|
Pressable,
|
|
6028
6200
|
{
|
|
6029
6201
|
onPress: () => onAvatarPress(sender),
|
|
@@ -6033,14 +6205,14 @@ function BubbleMessageRow({
|
|
|
6033
6205
|
children: avatar
|
|
6034
6206
|
}
|
|
6035
6207
|
) : avatar }) : null,
|
|
6036
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
6208
|
+
/* @__PURE__ */ jsxs(View, { style: styles27.bubbleCol, children: [
|
|
6037
6209
|
swipeEnabled ? /* @__PURE__ */ jsx(
|
|
6038
6210
|
Animated.View,
|
|
6039
6211
|
{
|
|
6040
6212
|
pointerEvents: "none",
|
|
6041
6213
|
style: [
|
|
6042
|
-
|
|
6043
|
-
isSelf ?
|
|
6214
|
+
styles27.replyHint,
|
|
6215
|
+
isSelf ? styles27.replyHintRight : styles27.replyHintLeft,
|
|
6044
6216
|
{
|
|
6045
6217
|
opacity: replyIconOpacity,
|
|
6046
6218
|
transform: [{ scale: replyIconScale }],
|
|
@@ -6062,8 +6234,12 @@ function BubbleMessageRow({
|
|
|
6062
6234
|
if (!actions || tombstone) return;
|
|
6063
6235
|
setActionsOpen(true);
|
|
6064
6236
|
},
|
|
6065
|
-
|
|
6066
|
-
|
|
6237
|
+
accessibilityLabel: messageA11yLabel(msg, senderLabel ?? "Unknown", isSelf),
|
|
6238
|
+
...actions && !tombstone ? {
|
|
6239
|
+
accessibilityHint: "Long press for message actions",
|
|
6240
|
+
accessibilityActions: [{ name: "longpress", label: "Message actions" }],
|
|
6241
|
+
onAccessibilityAction: () => setActionsOpen(true)
|
|
6242
|
+
} : {},
|
|
6067
6243
|
children: /* @__PURE__ */ jsx(
|
|
6068
6244
|
MessageBubble,
|
|
6069
6245
|
{
|
|
@@ -6092,6 +6268,15 @@ function BubbleMessageRow({
|
|
|
6092
6268
|
)
|
|
6093
6269
|
}
|
|
6094
6270
|
),
|
|
6271
|
+
/* @__PURE__ */ jsx(
|
|
6272
|
+
SendStatus,
|
|
6273
|
+
{
|
|
6274
|
+
message: msg,
|
|
6275
|
+
alignEnd: isSelf,
|
|
6276
|
+
...onRetrySend ? { onRetry: onRetrySend } : {},
|
|
6277
|
+
...onDiscardSend ? { onDiscard: onDiscardSend } : {}
|
|
6278
|
+
}
|
|
6279
|
+
),
|
|
6095
6280
|
renderSlot(
|
|
6096
6281
|
slots?.thread,
|
|
6097
6282
|
slotContext,
|
|
@@ -6109,7 +6294,7 @@ function BubbleMessageRow({
|
|
|
6109
6294
|
renderSlot(
|
|
6110
6295
|
slots?.reactions,
|
|
6111
6296
|
slotContext,
|
|
6112
|
-
reactions && !tombstone ? /* @__PURE__ */ jsx(View, { style: [
|
|
6297
|
+
reactions && !tombstone ? /* @__PURE__ */ jsx(View, { style: [styles27.reactionsRow, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: /* @__PURE__ */ jsx(
|
|
6113
6298
|
ReactionStrip,
|
|
6114
6299
|
{
|
|
6115
6300
|
messageId: msg.id,
|
|
@@ -6160,7 +6345,7 @@ function BubbleMessageRow({
|
|
|
6160
6345
|
}
|
|
6161
6346
|
);
|
|
6162
6347
|
}
|
|
6163
|
-
var
|
|
6348
|
+
var styles27 = StyleSheet.create({
|
|
6164
6349
|
row: {
|
|
6165
6350
|
flexDirection: "row",
|
|
6166
6351
|
alignItems: "flex-end",
|
|
@@ -6217,24 +6402,24 @@ function NewMessagesDivider({ label = "New messages" }) {
|
|
|
6217
6402
|
return /* @__PURE__ */ jsxs(
|
|
6218
6403
|
View,
|
|
6219
6404
|
{
|
|
6220
|
-
style: [
|
|
6405
|
+
style: [styles28.row, { paddingHorizontal: theme.spacing.md }],
|
|
6221
6406
|
accessibilityRole: "text",
|
|
6222
6407
|
accessibilityLabel: label,
|
|
6223
6408
|
children: [
|
|
6224
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
6409
|
+
/* @__PURE__ */ jsx(View, { style: [styles28.line, { backgroundColor: theme.colors.accent }] }),
|
|
6225
6410
|
/* @__PURE__ */ jsx(
|
|
6226
6411
|
Text,
|
|
6227
6412
|
{
|
|
6228
|
-
style: [
|
|
6413
|
+
style: [styles28.label, { color: theme.colors.accentStrong, fontFamily: theme.fonts.body }],
|
|
6229
6414
|
children: label
|
|
6230
6415
|
}
|
|
6231
6416
|
),
|
|
6232
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
6417
|
+
/* @__PURE__ */ jsx(View, { style: [styles28.line, { backgroundColor: theme.colors.accent }] })
|
|
6233
6418
|
]
|
|
6234
6419
|
}
|
|
6235
6420
|
);
|
|
6236
6421
|
}
|
|
6237
|
-
var
|
|
6422
|
+
var styles28 = StyleSheet.create({
|
|
6238
6423
|
row: {
|
|
6239
6424
|
flexDirection: "row",
|
|
6240
6425
|
alignItems: "center",
|
|
@@ -6403,15 +6588,15 @@ function ThreadSheet({
|
|
|
6403
6588
|
return /* @__PURE__ */ jsxs(
|
|
6404
6589
|
View,
|
|
6405
6590
|
{
|
|
6406
|
-
style:
|
|
6591
|
+
style: styles29.modalRoot,
|
|
6407
6592
|
onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
|
|
6408
6593
|
children: [
|
|
6409
|
-
/* @__PURE__ */ jsx(Pressable, { style:
|
|
6594
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles29.backdrop, onPress: onClose, accessibilityLabel: "Close thread" }),
|
|
6410
6595
|
/* @__PURE__ */ jsxs(
|
|
6411
6596
|
Animated.View,
|
|
6412
6597
|
{
|
|
6413
6598
|
style: [
|
|
6414
|
-
|
|
6599
|
+
styles29.sheet,
|
|
6415
6600
|
{
|
|
6416
6601
|
height: sheetHeight,
|
|
6417
6602
|
backgroundColor: theme.colors.background,
|
|
@@ -6425,14 +6610,14 @@ function ThreadSheet({
|
|
|
6425
6610
|
],
|
|
6426
6611
|
children: [
|
|
6427
6612
|
/* @__PURE__ */ jsxs(View, { ...panHandlers, children: [
|
|
6428
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
6429
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
6613
|
+
/* @__PURE__ */ jsx(View, { style: styles29.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles29.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
|
|
6614
|
+
/* @__PURE__ */ jsxs(View, { style: [styles29.header, { borderBottomColor: theme.colors.border }], children: [
|
|
6430
6615
|
/* @__PURE__ */ jsx(
|
|
6431
6616
|
Pressable,
|
|
6432
6617
|
{
|
|
6433
6618
|
onPress: onClose,
|
|
6434
6619
|
hitSlop: 16,
|
|
6435
|
-
style: [
|
|
6620
|
+
style: [styles29.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
6436
6621
|
accessibilityLabel: "Close thread",
|
|
6437
6622
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
|
|
6438
6623
|
}
|
|
@@ -6440,7 +6625,7 @@ function ThreadSheet({
|
|
|
6440
6625
|
/* @__PURE__ */ jsx(
|
|
6441
6626
|
Text,
|
|
6442
6627
|
{
|
|
6443
|
-
style: [
|
|
6628
|
+
style: [styles29.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
|
|
6444
6629
|
children: "Thread"
|
|
6445
6630
|
}
|
|
6446
6631
|
)
|
|
@@ -6449,18 +6634,25 @@ function ThreadSheet({
|
|
|
6449
6634
|
/* @__PURE__ */ jsxs(
|
|
6450
6635
|
KeyboardAvoidingView,
|
|
6451
6636
|
{
|
|
6452
|
-
style:
|
|
6637
|
+
style: styles29.kavBody,
|
|
6453
6638
|
behavior: "padding",
|
|
6454
6639
|
keyboardVerticalOffset: gutter,
|
|
6455
6640
|
children: [
|
|
6456
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
6457
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
6641
|
+
/* @__PURE__ */ jsx(View, { style: [styles29.rootPreview, { backgroundColor: theme.colors.surfaceAlt }], children: rootRow }),
|
|
6642
|
+
/* @__PURE__ */ jsx(View, { style: styles29.listWrap, children: /* @__PURE__ */ jsx(
|
|
6458
6643
|
MessageList,
|
|
6459
6644
|
{
|
|
6460
6645
|
messages: replies,
|
|
6461
6646
|
hasMore,
|
|
6462
6647
|
onLoadMore: loadMore,
|
|
6463
|
-
renderItem: renderReply
|
|
6648
|
+
renderItem: renderReply,
|
|
6649
|
+
emptyState: /* @__PURE__ */ jsx(
|
|
6650
|
+
EmptyState,
|
|
6651
|
+
{
|
|
6652
|
+
title: "No replies yet",
|
|
6653
|
+
hint: "Write a reply below to start the thread."
|
|
6654
|
+
}
|
|
6655
|
+
)
|
|
6464
6656
|
}
|
|
6465
6657
|
) }),
|
|
6466
6658
|
/* @__PURE__ */ jsx(
|
|
@@ -6492,7 +6684,7 @@ function ThreadSheet({
|
|
|
6492
6684
|
}
|
|
6493
6685
|
);
|
|
6494
6686
|
}
|
|
6495
|
-
var
|
|
6687
|
+
var styles29 = StyleSheet.create({
|
|
6496
6688
|
modalRoot: {
|
|
6497
6689
|
flex: 1,
|
|
6498
6690
|
justifyContent: "flex-end"
|
|
@@ -6564,7 +6756,7 @@ function TypingIndicator({ typing, labelFor }) {
|
|
|
6564
6756
|
const ids = Array.from(typing);
|
|
6565
6757
|
const isTyping = ids.length > 0;
|
|
6566
6758
|
if (!isTyping) return /* @__PURE__ */ jsx(View, { style: { height: 0 } });
|
|
6567
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
6759
|
+
return /* @__PURE__ */ jsxs(View, { style: styles30.row, children: [
|
|
6568
6760
|
/* @__PURE__ */ jsx(TypingDots, {}),
|
|
6569
6761
|
/* @__PURE__ */ jsx(TypingLabel, { ids, ...labelFor ? { labelFor } : {} })
|
|
6570
6762
|
] });
|
|
@@ -6609,7 +6801,7 @@ function TypingDots() {
|
|
|
6609
6801
|
],
|
|
6610
6802
|
opacity: val.interpolate({ inputRange: [0, 1], outputRange: [0.5, 1] })
|
|
6611
6803
|
});
|
|
6612
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
6804
|
+
return /* @__PURE__ */ jsxs(View, { style: styles30.dotsWrap, children: [
|
|
6613
6805
|
/* @__PURE__ */ jsx(Animated.View, { style: dot(a) }),
|
|
6614
6806
|
/* @__PURE__ */ jsx(Animated.View, { style: dot(b) }),
|
|
6615
6807
|
/* @__PURE__ */ jsx(Animated.View, { style: dot(c) })
|
|
@@ -6625,9 +6817,9 @@ function TypingLabel({
|
|
|
6625
6817
|
const name1 = useDisplayName(id1, labelFor);
|
|
6626
6818
|
const name2 = useDisplayName(id2, labelFor);
|
|
6627
6819
|
const text = ids.length === 1 ? `${name1} is typing` : ids.length === 2 ? `${name1} and ${name2} are typing` : `${ids.length} people are typing`;
|
|
6628
|
-
return /* @__PURE__ */ jsx(Text, { style: [
|
|
6820
|
+
return /* @__PURE__ */ jsx(Text, { style: [styles30.label, { color: theme.colors.textMuted, fontFamily: theme.fonts.body }], children: text });
|
|
6629
6821
|
}
|
|
6630
|
-
var
|
|
6822
|
+
var styles30 = StyleSheet.create({
|
|
6631
6823
|
row: {
|
|
6632
6824
|
flexDirection: "row",
|
|
6633
6825
|
alignItems: "center",
|
|
@@ -6665,21 +6857,40 @@ function parseDraft(raw) {
|
|
|
6665
6857
|
}
|
|
6666
6858
|
}
|
|
6667
6859
|
var DraftStore = class {
|
|
6860
|
+
/**
|
|
6861
|
+
* `namespace` resolves to the client's namespace; without it keys are
|
|
6862
|
+
* the pre-3.8 `poolse:draft:<conversation>` (tests, single client).
|
|
6863
|
+
*/
|
|
6864
|
+
constructor(namespace) {
|
|
6865
|
+
this.namespace = namespace;
|
|
6866
|
+
}
|
|
6867
|
+
namespace;
|
|
6668
6868
|
memory = /* @__PURE__ */ new Map();
|
|
6869
|
+
written = /* @__PURE__ */ new Map();
|
|
6669
6870
|
/** The in-memory draft, if any. */
|
|
6670
6871
|
peek(conversationId) {
|
|
6671
6872
|
return this.memory.get(conversationId) ?? null;
|
|
6672
6873
|
}
|
|
6673
6874
|
/**
|
|
6674
6875
|
* The draft: from memory, else from `storage` (which then seeds the
|
|
6675
|
-
* memory). Null when there's none, or
|
|
6876
|
+
* memory; a pre-3.8 key is moved over). Null when there's none, or
|
|
6877
|
+
* storage fails.
|
|
6676
6878
|
*/
|
|
6677
6879
|
async load(conversationId, storage) {
|
|
6678
6880
|
const inMemory = this.memory.get(conversationId);
|
|
6679
6881
|
if (inMemory) return inMemory;
|
|
6680
6882
|
if (!storage) return null;
|
|
6681
6883
|
try {
|
|
6682
|
-
const
|
|
6884
|
+
const key = await this.key(conversationId);
|
|
6885
|
+
let stored = parseDraft(await storage.get(key));
|
|
6886
|
+
const legacy = draftKey(conversationId);
|
|
6887
|
+
if (!stored && key !== legacy) {
|
|
6888
|
+
stored = parseDraft(await storage.get(legacy));
|
|
6889
|
+
if (stored && !isEmptyDraft(stored)) {
|
|
6890
|
+
this.write(storage, key, stored);
|
|
6891
|
+
swallow(() => storage.remove(legacy));
|
|
6892
|
+
}
|
|
6893
|
+
}
|
|
6683
6894
|
if (stored && !isEmptyDraft(stored) && !this.memory.has(conversationId)) {
|
|
6684
6895
|
this.memory.set(conversationId, stored);
|
|
6685
6896
|
}
|
|
@@ -6695,15 +6906,72 @@ var DraftStore = class {
|
|
|
6695
6906
|
return;
|
|
6696
6907
|
}
|
|
6697
6908
|
this.memory.set(conversationId, draft);
|
|
6698
|
-
if (storage) {
|
|
6699
|
-
|
|
6909
|
+
if (storage && !this.namespace) {
|
|
6910
|
+
this.write(storage, draftKey(conversationId), draft);
|
|
6911
|
+
} else if (storage) {
|
|
6912
|
+
void this.key(conversationId).then(
|
|
6913
|
+
(key) => this.write(storage, key, draft),
|
|
6914
|
+
() => void 0
|
|
6915
|
+
);
|
|
6700
6916
|
}
|
|
6701
6917
|
}
|
|
6702
6918
|
clear(conversationId, storage) {
|
|
6703
6919
|
this.memory.delete(conversationId);
|
|
6704
|
-
if (storage
|
|
6920
|
+
if (storage && !this.namespace) {
|
|
6921
|
+
swallow(() => storage.remove(draftKey(conversationId)));
|
|
6922
|
+
} else if (storage) {
|
|
6923
|
+
void this.key(conversationId).then(
|
|
6924
|
+
(key) => swallow(() => storage.remove(key)),
|
|
6925
|
+
() => void 0
|
|
6926
|
+
);
|
|
6927
|
+
}
|
|
6928
|
+
}
|
|
6929
|
+
/** Called by `chat.destroy()`. @internal */
|
|
6930
|
+
async destroy(opts) {
|
|
6931
|
+
this.memory.clear();
|
|
6932
|
+
if (!opts.clearStorage) return;
|
|
6933
|
+
const ns = this.namespace ? await this.namespace() : null;
|
|
6934
|
+
for (const [storage, keys] of this.written) {
|
|
6935
|
+
const all = new Set(keys);
|
|
6936
|
+
if (ns) {
|
|
6937
|
+
try {
|
|
6938
|
+
const listed = JSON.parse(await storage.get(indexKey(ns)) ?? "[]");
|
|
6939
|
+
if (Array.isArray(listed)) {
|
|
6940
|
+
for (const k of listed) if (typeof k === "string") all.add(k);
|
|
6941
|
+
}
|
|
6942
|
+
} catch {
|
|
6943
|
+
}
|
|
6944
|
+
swallow(() => storage.remove(indexKey(ns)));
|
|
6945
|
+
}
|
|
6946
|
+
for (const k of all) swallow(() => storage.remove(k));
|
|
6947
|
+
}
|
|
6948
|
+
this.written.clear();
|
|
6949
|
+
}
|
|
6950
|
+
async key(conversationId) {
|
|
6951
|
+
if (!this.namespace) return draftKey(conversationId);
|
|
6952
|
+
return `${await this.namespace()}:draft:${conversationId}`;
|
|
6953
|
+
}
|
|
6954
|
+
write(storage, key, draft) {
|
|
6955
|
+
swallow(() => storage.set(key, JSON.stringify(draft)));
|
|
6956
|
+
let keys = this.written.get(storage);
|
|
6957
|
+
if (!keys) {
|
|
6958
|
+
keys = /* @__PURE__ */ new Set();
|
|
6959
|
+
this.written.set(storage, keys);
|
|
6960
|
+
}
|
|
6961
|
+
if (keys.has(key) || !this.namespace) return;
|
|
6962
|
+
keys.add(key);
|
|
6963
|
+
const all = keys;
|
|
6964
|
+
void this.namespace().then(async (ns) => {
|
|
6965
|
+
try {
|
|
6966
|
+
const listed = JSON.parse(await storage.get(indexKey(ns)) ?? "[]");
|
|
6967
|
+
const prev = Array.isArray(listed) ? listed.filter((k) => typeof k === "string") : [];
|
|
6968
|
+
await storage.set(indexKey(ns), JSON.stringify([.../* @__PURE__ */ new Set([...prev, ...all])]));
|
|
6969
|
+
} catch {
|
|
6970
|
+
}
|
|
6971
|
+
});
|
|
6705
6972
|
}
|
|
6706
6973
|
};
|
|
6974
|
+
var indexKey = (ns) => `${ns}:draft-index`;
|
|
6707
6975
|
function swallow(fn) {
|
|
6708
6976
|
try {
|
|
6709
6977
|
const r = fn();
|
|
@@ -6713,7 +6981,9 @@ function swallow(fn) {
|
|
|
6713
6981
|
} catch {
|
|
6714
6982
|
}
|
|
6715
6983
|
}
|
|
6716
|
-
|
|
6984
|
+
function draftStoreOf(chat) {
|
|
6985
|
+
return chat.scoped("react-native:drafts", (c) => new DraftStore(() => c.whenNamespace()));
|
|
6986
|
+
}
|
|
6717
6987
|
|
|
6718
6988
|
// src/internal/errors.ts
|
|
6719
6989
|
function sendErrorNotice(err) {
|
|
@@ -6828,11 +7098,14 @@ function ConversationView({
|
|
|
6828
7098
|
loadMore,
|
|
6829
7099
|
loadUntil,
|
|
6830
7100
|
send,
|
|
7101
|
+
retry: retrySend,
|
|
7102
|
+
discard: discardSend,
|
|
6831
7103
|
edit,
|
|
6832
7104
|
delete: deleteMsg,
|
|
6833
7105
|
markReadUpTo,
|
|
6834
7106
|
refetch
|
|
6835
7107
|
} = useMessages(conversationId);
|
|
7108
|
+
const drafts = draftStoreOf(chat);
|
|
6836
7109
|
const { typing: typingPeople, signalTyping } = useTyping(conversationId);
|
|
6837
7110
|
const streams = useMessageStreams(conversationId);
|
|
6838
7111
|
const typing = useMemo(() => {
|
|
@@ -6873,24 +7146,22 @@ function ConversationView({
|
|
|
6873
7146
|
[layout, density, timeFormat, slots]
|
|
6874
7147
|
);
|
|
6875
7148
|
const [draftFor, setDraftFor] = useState(conversationId);
|
|
6876
|
-
const [draftText, setDraftText] = useState(
|
|
6877
|
-
() => sharedDraftStore.peek(conversationId)?.text ?? ""
|
|
6878
|
-
);
|
|
7149
|
+
const [draftText, setDraftText] = useState(() => drafts.peek(conversationId)?.text ?? "");
|
|
6879
7150
|
const [replyingTo, setReplyingTo] = useState(
|
|
6880
|
-
() =>
|
|
7151
|
+
() => drafts.peek(conversationId)?.quote ?? null
|
|
6881
7152
|
);
|
|
6882
7153
|
const touchedRef = useRef(false);
|
|
6883
7154
|
const [storedDraftRead, setStoredDraftRead] = useState(false);
|
|
6884
7155
|
useEffect(() => {
|
|
6885
7156
|
let live = true;
|
|
6886
7157
|
touchedRef.current = false;
|
|
6887
|
-
const inMemory =
|
|
7158
|
+
const inMemory = drafts.peek(conversationId);
|
|
6888
7159
|
setDraftFor(conversationId);
|
|
6889
7160
|
setDraftText(inMemory?.text ?? "");
|
|
6890
7161
|
setReplyingTo(inMemory?.quote ?? null);
|
|
6891
7162
|
if (!inMemory && storage) {
|
|
6892
7163
|
setStoredDraftRead(false);
|
|
6893
|
-
void
|
|
7164
|
+
void drafts.load(conversationId, storage).then((d) => {
|
|
6894
7165
|
if (!live) return;
|
|
6895
7166
|
setStoredDraftRead(true);
|
|
6896
7167
|
if (!d || touchedRef.current) return;
|
|
@@ -6908,23 +7179,23 @@ function ConversationView({
|
|
|
6908
7179
|
useEffect(() => {
|
|
6909
7180
|
if (draftFor !== conversationId) return;
|
|
6910
7181
|
const draft = { text: draftText, quote: replyingTo };
|
|
6911
|
-
|
|
7182
|
+
drafts.save(conversationId, draft);
|
|
6912
7183
|
if (!storage || !storedDraftRead) return;
|
|
6913
7184
|
pendingDraftRef.current = { id: conversationId, draft };
|
|
6914
7185
|
const t = setTimeout(() => {
|
|
6915
7186
|
pendingDraftRef.current = null;
|
|
6916
|
-
|
|
7187
|
+
drafts.save(conversationId, draft, storage);
|
|
6917
7188
|
}, 400);
|
|
6918
7189
|
return () => clearTimeout(t);
|
|
6919
|
-
}, [draftFor, conversationId, draftText, replyingTo, storage, storedDraftRead]);
|
|
7190
|
+
}, [drafts, draftFor, conversationId, draftText, replyingTo, storage, storedDraftRead]);
|
|
6920
7191
|
const storageRef = useRef(storage);
|
|
6921
7192
|
storageRef.current = storage;
|
|
6922
7193
|
useEffect(
|
|
6923
7194
|
() => () => {
|
|
6924
7195
|
const pending = pendingDraftRef.current;
|
|
6925
|
-
if (pending)
|
|
7196
|
+
if (pending) drafts.save(pending.id, pending.draft, storageRef.current);
|
|
6926
7197
|
},
|
|
6927
|
-
[]
|
|
7198
|
+
[drafts]
|
|
6928
7199
|
);
|
|
6929
7200
|
const [notice, setNotice] = useState(null);
|
|
6930
7201
|
useEffect(() => {
|
|
@@ -7111,6 +7382,10 @@ function ConversationView({
|
|
|
7111
7382
|
showPresence,
|
|
7112
7383
|
linkPreviews,
|
|
7113
7384
|
...markable ? { onMarkUnread: () => markMessageUnread(msg) } : {},
|
|
7385
|
+
...msg.local_status ? {
|
|
7386
|
+
onRetrySend: () => void retrySend(msg.id).catch(() => void 0),
|
|
7387
|
+
onDiscardSend: () => discardSend(msg.id)
|
|
7388
|
+
} : {},
|
|
7114
7389
|
...linkPreviews && isSelf && !tombstone && (msg.link_previews?.length ?? 0) > 0 ? { onRemoveLinkPreview: (url) => removeLinkPreview(msg.id, url) } : {},
|
|
7115
7390
|
reactions,
|
|
7116
7391
|
attachments,
|
|
@@ -7142,6 +7417,8 @@ function ConversationView({
|
|
|
7142
7417
|
return /* @__PURE__ */ jsx(View, { style: { backgroundColor: theme.colors.accentSoft }, children: row });
|
|
7143
7418
|
},
|
|
7144
7419
|
[
|
|
7420
|
+
retrySend,
|
|
7421
|
+
discardSend,
|
|
7145
7422
|
onCallBack,
|
|
7146
7423
|
onQuotedClick,
|
|
7147
7424
|
onSenderPress,
|
|
@@ -7217,9 +7494,17 @@ function ConversationView({
|
|
|
7217
7494
|
const composerProps = useMemo(
|
|
7218
7495
|
() => ({
|
|
7219
7496
|
onSend: async (body, opts) => {
|
|
7497
|
+
const id = safeUuid();
|
|
7220
7498
|
try {
|
|
7221
|
-
await send({ body, ...opts });
|
|
7499
|
+
await send({ body, ...opts, id });
|
|
7222
7500
|
} catch (err) {
|
|
7501
|
+
const kept = err instanceof MessageQueuedError || chat.outboxEnabled && !isQuoteGone(err);
|
|
7502
|
+
if (kept) {
|
|
7503
|
+
setReplyingTo(null);
|
|
7504
|
+
setAutoReadPaused(false);
|
|
7505
|
+
return;
|
|
7506
|
+
}
|
|
7507
|
+
if (isQuoteGone(err)) discardSend(id);
|
|
7223
7508
|
setDraftText((now) => now ? now : body);
|
|
7224
7509
|
if (isQuoteGone(err)) setReplyingTo(null);
|
|
7225
7510
|
setNotice(sendErrorNotice(err));
|
|
@@ -7252,6 +7537,8 @@ function ConversationView({
|
|
|
7252
7537
|
}),
|
|
7253
7538
|
[
|
|
7254
7539
|
send,
|
|
7540
|
+
chat.outboxEnabled,
|
|
7541
|
+
discardSend,
|
|
7255
7542
|
signalTyping,
|
|
7256
7543
|
attachments,
|
|
7257
7544
|
replyingTo,
|
|
@@ -7279,7 +7566,7 @@ function ConversationView({
|
|
|
7279
7566
|
return /* @__PURE__ */ jsx(UploadProvider, { children: /* @__PURE__ */ jsxs(
|
|
7280
7567
|
KeyboardAvoidingView,
|
|
7281
7568
|
{
|
|
7282
|
-
style: [
|
|
7569
|
+
style: [styles31.root, { backgroundColor: theme.colors.background }],
|
|
7283
7570
|
behavior: Platform.OS === "ios" ? "padding" : "height",
|
|
7284
7571
|
keyboardVerticalOffset: keyboardOffset,
|
|
7285
7572
|
children: [
|
|
@@ -7288,7 +7575,7 @@ function ConversationView({
|
|
|
7288
7575
|
Text,
|
|
7289
7576
|
{
|
|
7290
7577
|
style: [
|
|
7291
|
-
|
|
7578
|
+
styles31.notice,
|
|
7292
7579
|
{ color: theme.colors.textMuted, backgroundColor: theme.colors.surfaceAlt }
|
|
7293
7580
|
],
|
|
7294
7581
|
accessibilityRole: "alert",
|
|
@@ -7304,7 +7591,7 @@ function ConversationView({
|
|
|
7304
7591
|
onJoin: onJoinCall
|
|
7305
7592
|
}
|
|
7306
7593
|
) : null,
|
|
7307
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
7594
|
+
/* @__PURE__ */ jsxs(View, { style: styles31.listWrap, children: [
|
|
7308
7595
|
/* @__PURE__ */ jsx(
|
|
7309
7596
|
MessageList,
|
|
7310
7597
|
{
|
|
@@ -7323,7 +7610,7 @@ function ConversationView({
|
|
|
7323
7610
|
(stream) => stream.status === "failed" ? /* @__PURE__ */ jsx(
|
|
7324
7611
|
Text,
|
|
7325
7612
|
{
|
|
7326
|
-
style: [
|
|
7613
|
+
style: [styles31.streamFailed, { color: theme.colors.textSubtle }],
|
|
7327
7614
|
accessibilityRole: "alert",
|
|
7328
7615
|
children: stream.error ? `The agent couldn't reply: ${stream.error}` : "The agent couldn't reply."
|
|
7329
7616
|
},
|
|
@@ -7350,7 +7637,13 @@ function ConversationView({
|
|
|
7350
7637
|
),
|
|
7351
7638
|
/* @__PURE__ */ jsx(TypingIndicator, { typing, ...labelFor ? { labelFor } : {} })
|
|
7352
7639
|
] }),
|
|
7353
|
-
|
|
7640
|
+
emptyState: emptyState !== void 0 ? emptyState : /* @__PURE__ */ jsx(
|
|
7641
|
+
EmptyState,
|
|
7642
|
+
{
|
|
7643
|
+
title: "No messages yet",
|
|
7644
|
+
...showComposer ? { hint: "Write the first message below \u2014 everyone here will see it." } : {}
|
|
7645
|
+
}
|
|
7646
|
+
)
|
|
7354
7647
|
}
|
|
7355
7648
|
),
|
|
7356
7649
|
unreadPending ? /* @__PURE__ */ jsxs(
|
|
@@ -7358,7 +7651,7 @@ function ConversationView({
|
|
|
7358
7651
|
{
|
|
7359
7652
|
onPress: jumpToUnread,
|
|
7360
7653
|
style: [
|
|
7361
|
-
|
|
7654
|
+
styles31.unreadPill,
|
|
7362
7655
|
{ backgroundColor: theme.colors.accent, borderRadius: theme.radii.pill },
|
|
7363
7656
|
theme.shadows.sm
|
|
7364
7657
|
],
|
|
@@ -7374,7 +7667,7 @@ function ConversationView({
|
|
|
7374
7667
|
label: null
|
|
7375
7668
|
}
|
|
7376
7669
|
),
|
|
7377
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
7670
|
+
/* @__PURE__ */ jsx(Text, { style: [styles31.unreadPillText, { color: theme.colors.accentText }], children: seekingUnread ? "Loading\u2026" : "New messages" }),
|
|
7378
7671
|
/* @__PURE__ */ jsx(
|
|
7379
7672
|
Pressable,
|
|
7380
7673
|
{
|
|
@@ -7391,7 +7684,7 @@ function ConversationView({
|
|
|
7391
7684
|
editingId ? /* @__PURE__ */ jsx(
|
|
7392
7685
|
Pressable,
|
|
7393
7686
|
{
|
|
7394
|
-
style: [
|
|
7687
|
+
style: [styles31.editBackdrop, { backgroundColor: theme.colors.overlay }],
|
|
7395
7688
|
onPress: () => setEditingId(null),
|
|
7396
7689
|
accessibilityLabel: "Cancel editing"
|
|
7397
7690
|
}
|
|
@@ -7453,7 +7746,7 @@ function readStateForMessage(msg, members, meId, sequenceByMessageId) {
|
|
|
7453
7746
|
return anyRead ? "read" : "sent";
|
|
7454
7747
|
}
|
|
7455
7748
|
var NEW_MESSAGES_KEY = "new-messages";
|
|
7456
|
-
var
|
|
7749
|
+
var styles31 = StyleSheet.create({
|
|
7457
7750
|
root: {
|
|
7458
7751
|
flex: 1
|
|
7459
7752
|
},
|
|
@@ -7589,15 +7882,15 @@ function UserPickerSheet({
|
|
|
7589
7882
|
children: /* @__PURE__ */ jsxs(
|
|
7590
7883
|
View,
|
|
7591
7884
|
{
|
|
7592
|
-
style:
|
|
7885
|
+
style: styles32.modalRoot,
|
|
7593
7886
|
onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
|
|
7594
7887
|
children: [
|
|
7595
|
-
/* @__PURE__ */ jsx(Pressable, { style:
|
|
7888
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles32.backdrop, onPress: handleClose }),
|
|
7596
7889
|
/* @__PURE__ */ jsx(
|
|
7597
7890
|
Animated.View,
|
|
7598
7891
|
{
|
|
7599
7892
|
style: [
|
|
7600
|
-
|
|
7893
|
+
styles32.sheet,
|
|
7601
7894
|
{
|
|
7602
7895
|
backgroundColor: theme.colors.background,
|
|
7603
7896
|
borderTopLeftRadius: theme.radii.xl,
|
|
@@ -7615,18 +7908,18 @@ function UserPickerSheet({
|
|
|
7615
7908
|
children: /* @__PURE__ */ jsxs(
|
|
7616
7909
|
KeyboardAvoidingView,
|
|
7617
7910
|
{
|
|
7618
|
-
style:
|
|
7911
|
+
style: styles32.kav,
|
|
7619
7912
|
behavior: "padding",
|
|
7620
7913
|
keyboardVerticalOffset: screenHeight - sheetHeight,
|
|
7621
7914
|
children: [
|
|
7622
|
-
/* @__PURE__ */ jsx(View, { ...panHandlers, style:
|
|
7623
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
7915
|
+
/* @__PURE__ */ jsx(View, { ...panHandlers, style: styles32.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles32.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
|
|
7916
|
+
/* @__PURE__ */ jsxs(View, { style: styles32.header, children: [
|
|
7624
7917
|
/* @__PURE__ */ jsx(
|
|
7625
7918
|
Pressable,
|
|
7626
7919
|
{
|
|
7627
7920
|
onPress: handleClose,
|
|
7628
7921
|
hitSlop: 16,
|
|
7629
|
-
style: [
|
|
7922
|
+
style: [styles32.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
|
|
7630
7923
|
accessibilityLabel: "Close picker",
|
|
7631
7924
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
|
|
7632
7925
|
}
|
|
@@ -7635,7 +7928,7 @@ function UserPickerSheet({
|
|
|
7635
7928
|
Text,
|
|
7636
7929
|
{
|
|
7637
7930
|
style: [
|
|
7638
|
-
|
|
7931
|
+
styles32.title,
|
|
7639
7932
|
{ color: theme.colors.text, fontFamily: theme.fonts.display }
|
|
7640
7933
|
],
|
|
7641
7934
|
numberOfLines: 1,
|
|
@@ -7649,7 +7942,7 @@ function UserPickerSheet({
|
|
|
7649
7942
|
disabled: !canCreate,
|
|
7650
7943
|
hitSlop: 6,
|
|
7651
7944
|
style: [
|
|
7652
|
-
|
|
7945
|
+
styles32.createBtn,
|
|
7653
7946
|
{
|
|
7654
7947
|
backgroundColor: canCreate ? theme.colors.accent : theme.colors.surfaceAlt,
|
|
7655
7948
|
opacity: canCreate ? 1 : 0.6
|
|
@@ -7680,7 +7973,7 @@ function UserPickerSheet({
|
|
|
7680
7973
|
value: groupName,
|
|
7681
7974
|
onChangeText: setGroupName,
|
|
7682
7975
|
style: [
|
|
7683
|
-
|
|
7976
|
+
styles32.groupNameInput,
|
|
7684
7977
|
{
|
|
7685
7978
|
color: theme.colors.text,
|
|
7686
7979
|
backgroundColor: theme.colors.surfaceAlt,
|
|
@@ -7699,7 +7992,7 @@ function UserPickerSheet({
|
|
|
7699
7992
|
value: query,
|
|
7700
7993
|
onChangeText: setQuery,
|
|
7701
7994
|
style: [
|
|
7702
|
-
|
|
7995
|
+
styles32.searchInput,
|
|
7703
7996
|
{
|
|
7704
7997
|
color: theme.colors.text,
|
|
7705
7998
|
backgroundColor: theme.colors.surfaceAlt,
|
|
@@ -7716,7 +8009,7 @@ function UserPickerSheet({
|
|
|
7716
8009
|
data: filtered,
|
|
7717
8010
|
keyExtractor: (u) => u.externalId,
|
|
7718
8011
|
keyboardShouldPersistTaps: "handled",
|
|
7719
|
-
ListEmptyComponent: /* @__PURE__ */ jsx(View, { style:
|
|
8012
|
+
ListEmptyComponent: /* @__PURE__ */ jsx(View, { style: styles32.empty, children: /* @__PURE__ */ jsx(Text, { style: [styles32.emptyText, { color: theme.colors.textSubtle }], children: query ? "No matches." : "No users to show." }) }),
|
|
7720
8013
|
renderItem: ({ item }) => /* @__PURE__ */ jsx(
|
|
7721
8014
|
UserRow,
|
|
7722
8015
|
{
|
|
@@ -7758,29 +8051,29 @@ function UserRow({
|
|
|
7758
8051
|
{
|
|
7759
8052
|
onPress,
|
|
7760
8053
|
style: [
|
|
7761
|
-
|
|
8054
|
+
styles32.row,
|
|
7762
8055
|
{
|
|
7763
8056
|
backgroundColor: selected ? theme.colors.accentSoft : "transparent"
|
|
7764
8057
|
}
|
|
7765
8058
|
],
|
|
7766
8059
|
children: [
|
|
7767
|
-
user.avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: user.avatarUrl }, style:
|
|
7768
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
8060
|
+
user.avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: user.avatarUrl }, style: styles32.avatarImg }) : /* @__PURE__ */ jsx(Avatar, { src: null, name: user.name, seed: user.externalId, size: "md" }),
|
|
8061
|
+
/* @__PURE__ */ jsxs(View, { style: styles32.body, children: [
|
|
7769
8062
|
/* @__PURE__ */ jsx(
|
|
7770
8063
|
Text,
|
|
7771
8064
|
{
|
|
7772
|
-
style: [
|
|
8065
|
+
style: [styles32.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
7773
8066
|
numberOfLines: 1,
|
|
7774
8067
|
children: user.name
|
|
7775
8068
|
}
|
|
7776
8069
|
),
|
|
7777
|
-
user.subtitle ? /* @__PURE__ */ jsx(Text, { style: [
|
|
8070
|
+
user.subtitle ? /* @__PURE__ */ jsx(Text, { style: [styles32.subtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: user.subtitle }) : null
|
|
7778
8071
|
] }),
|
|
7779
8072
|
isGroup ? /* @__PURE__ */ jsx(
|
|
7780
8073
|
View,
|
|
7781
8074
|
{
|
|
7782
8075
|
style: [
|
|
7783
|
-
|
|
8076
|
+
styles32.checkbox,
|
|
7784
8077
|
{
|
|
7785
8078
|
borderColor: selected ? theme.colors.accent : theme.colors.border,
|
|
7786
8079
|
backgroundColor: selected ? theme.colors.accent : "transparent"
|
|
@@ -7793,7 +8086,7 @@ function UserRow({
|
|
|
7793
8086
|
}
|
|
7794
8087
|
);
|
|
7795
8088
|
}
|
|
7796
|
-
var
|
|
8089
|
+
var styles32 = StyleSheet.create({
|
|
7797
8090
|
modalRoot: {
|
|
7798
8091
|
flex: 1,
|
|
7799
8092
|
justifyContent: "flex-end"
|
|
@@ -8064,7 +8357,7 @@ var PoolseInbox = forwardRef(
|
|
|
8064
8357
|
},
|
|
8065
8358
|
[renderConversationRow, meExternalId, meId, labelFor, avatarFor, unreadCounts, showPresence]
|
|
8066
8359
|
);
|
|
8067
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
8360
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles33.root, { backgroundColor: theme.colors.background }], children: [
|
|
8068
8361
|
/* @__PURE__ */ jsxs(
|
|
8069
8362
|
Animated.View,
|
|
8070
8363
|
{
|
|
@@ -8075,7 +8368,7 @@ var PoolseInbox = forwardRef(
|
|
|
8075
8368
|
View,
|
|
8076
8369
|
{
|
|
8077
8370
|
style: [
|
|
8078
|
-
|
|
8371
|
+
styles33.listHeader,
|
|
8079
8372
|
{
|
|
8080
8373
|
backgroundColor: theme.colors.surface,
|
|
8081
8374
|
borderBottomColor: theme.colors.border
|
|
@@ -8086,13 +8379,13 @@ var PoolseInbox = forwardRef(
|
|
|
8086
8379
|
Text,
|
|
8087
8380
|
{
|
|
8088
8381
|
style: [
|
|
8089
|
-
|
|
8382
|
+
styles33.listTitle,
|
|
8090
8383
|
{ color: theme.colors.text, fontFamily: theme.fonts.display }
|
|
8091
8384
|
],
|
|
8092
8385
|
children: title
|
|
8093
8386
|
}
|
|
8094
8387
|
),
|
|
8095
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
8388
|
+
/* @__PURE__ */ jsxs(View, { style: styles33.headerActions, children: [
|
|
8096
8389
|
users ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8097
8390
|
/* @__PURE__ */ jsx(
|
|
8098
8391
|
HeaderIconButton,
|
|
@@ -8208,7 +8501,7 @@ function HeaderIconButton({
|
|
|
8208
8501
|
hitSlop: 10,
|
|
8209
8502
|
accessibilityLabel: label,
|
|
8210
8503
|
style: ({ pressed }) => [
|
|
8211
|
-
|
|
8504
|
+
styles33.iconBtn,
|
|
8212
8505
|
{
|
|
8213
8506
|
backgroundColor: pressed ? theme.colors.surfaceAlt : "transparent"
|
|
8214
8507
|
}
|
|
@@ -8241,7 +8534,7 @@ function DefaultConversationRow({
|
|
|
8241
8534
|
{
|
|
8242
8535
|
onPress,
|
|
8243
8536
|
style: [
|
|
8244
|
-
|
|
8537
|
+
styles33.row,
|
|
8245
8538
|
{
|
|
8246
8539
|
backgroundColor: selected ? theme.colors.surfaceAlt : "transparent",
|
|
8247
8540
|
borderBottomColor: theme.colors.border
|
|
@@ -8258,23 +8551,23 @@ function DefaultConversationRow({
|
|
|
8258
8551
|
...presence ? { presence: presence.state, doNotDisturb: !!presence.do_not_disturb } : {}
|
|
8259
8552
|
}
|
|
8260
8553
|
),
|
|
8261
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
8554
|
+
/* @__PURE__ */ jsxs(View, { style: styles33.rowBody, children: [
|
|
8262
8555
|
/* @__PURE__ */ jsx(
|
|
8263
8556
|
Text,
|
|
8264
8557
|
{
|
|
8265
|
-
style: [
|
|
8558
|
+
style: [styles33.rowTitle, { color: theme.colors.text, fontFamily: theme.fonts.body }],
|
|
8266
8559
|
numberOfLines: 1,
|
|
8267
8560
|
children: title
|
|
8268
8561
|
}
|
|
8269
8562
|
),
|
|
8270
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
8563
|
+
/* @__PURE__ */ jsx(Text, { style: [styles33.rowSubtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview ?? (isDirect ? otherExtId ?? "" : `${(conv.member_external_ids ?? []).length} members`) })
|
|
8271
8564
|
] }),
|
|
8272
|
-
unread > 0 ? /* @__PURE__ */ jsx(View, { style: [
|
|
8565
|
+
unread > 0 ? /* @__PURE__ */ jsx(View, { style: [styles33.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsx(Text, { style: [styles33.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
|
|
8273
8566
|
]
|
|
8274
8567
|
}
|
|
8275
8568
|
);
|
|
8276
8569
|
}
|
|
8277
|
-
var
|
|
8570
|
+
var styles33 = StyleSheet.create({
|
|
8278
8571
|
root: {
|
|
8279
8572
|
flex: 1,
|
|
8280
8573
|
overflow: "hidden"
|
|
@@ -8410,9 +8703,9 @@ function useAppStateLifecycle(options = {}) {
|
|
|
8410
8703
|
const sub = AppState.addEventListener("change", (next) => {
|
|
8411
8704
|
if (next === "background") {
|
|
8412
8705
|
setActivity("idle");
|
|
8413
|
-
poolse.
|
|
8706
|
+
poolse.setBackground(true);
|
|
8414
8707
|
} else if (next === "active") {
|
|
8415
|
-
poolse.
|
|
8708
|
+
poolse.setBackground(false);
|
|
8416
8709
|
setActivity("active");
|
|
8417
8710
|
} else {
|
|
8418
8711
|
setActivity("idle");
|
|
@@ -8422,6 +8715,41 @@ function useAppStateLifecycle(options = {}) {
|
|
|
8422
8715
|
}, [poolse, presence]);
|
|
8423
8716
|
}
|
|
8424
8717
|
|
|
8718
|
+
// src/internal/background.ts
|
|
8719
|
+
function applyBackground(clients, active, appActive, keepConnected = []) {
|
|
8720
|
+
for (const c of clients) {
|
|
8721
|
+
if (c.destroyed) continue;
|
|
8722
|
+
const foreground = appActive && (c === active || keepConnected.includes(c));
|
|
8723
|
+
c.setBackground(!foreground);
|
|
8724
|
+
}
|
|
8725
|
+
}
|
|
8726
|
+
|
|
8727
|
+
// src/lifecycle/useBackgroundClients.ts
|
|
8728
|
+
function useBackgroundClients(clients, active, opts = {}) {
|
|
8729
|
+
const [appState, setAppState] = useState(AppState.currentState ?? "active");
|
|
8730
|
+
useEffect(() => {
|
|
8731
|
+
const sub = AppState.addEventListener("change", setAppState);
|
|
8732
|
+
return () => sub.remove();
|
|
8733
|
+
}, []);
|
|
8734
|
+
const appActive = appState !== "background";
|
|
8735
|
+
const keep = opts.keepConnected ?? EMPTY;
|
|
8736
|
+
const presence = opts.presence ?? true;
|
|
8737
|
+
const lastActive = useRef(null);
|
|
8738
|
+
useEffect(() => {
|
|
8739
|
+
applyBackground(clients, active, appActive, keep);
|
|
8740
|
+
}, [clients, active, appActive, keep]);
|
|
8741
|
+
useEffect(() => {
|
|
8742
|
+
if (!presence) return;
|
|
8743
|
+
const prev = lastActive.current;
|
|
8744
|
+
if (prev && prev !== active && !prev.destroyed) prev.presence.setActivity("idle");
|
|
8745
|
+
lastActive.current = active;
|
|
8746
|
+
if (active && !active.destroyed) {
|
|
8747
|
+
active.presence.setActivity(appState === "active" ? "active" : "idle");
|
|
8748
|
+
}
|
|
8749
|
+
}, [active, appState, presence]);
|
|
8750
|
+
}
|
|
8751
|
+
var EMPTY = [];
|
|
8752
|
+
|
|
8425
8753
|
// src/voice/callTheme.ts
|
|
8426
8754
|
var callColors = {
|
|
8427
8755
|
/** Behind everything. Near-black, cooled toward the brand. */
|
|
@@ -8470,7 +8798,7 @@ function CallControlButton({
|
|
|
8470
8798
|
const size = large ? CONTROL_SIZE_LARGE : CONTROL_SIZE;
|
|
8471
8799
|
const background = tone === "danger" ? callColors.danger : tone === "accept" ? callColors.accept : active ? callColors.controlActive : callColors.control;
|
|
8472
8800
|
const iconColor = tone === "neutral" && active ? callColors.controlActiveIcon : callColors.onAction;
|
|
8473
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
8801
|
+
return /* @__PURE__ */ jsxs(View, { style: styles34.slot, children: [
|
|
8474
8802
|
/* @__PURE__ */ jsx(
|
|
8475
8803
|
Pressable,
|
|
8476
8804
|
{
|
|
@@ -8481,7 +8809,7 @@ function CallControlButton({
|
|
|
8481
8809
|
accessibilityLabel: accessibilityLabel ?? label ?? icon,
|
|
8482
8810
|
hitSlop: 8,
|
|
8483
8811
|
style: ({ pressed }) => [
|
|
8484
|
-
|
|
8812
|
+
styles34.button,
|
|
8485
8813
|
{
|
|
8486
8814
|
width: size,
|
|
8487
8815
|
height: size,
|
|
@@ -8495,10 +8823,10 @@ function CallControlButton({
|
|
|
8495
8823
|
children: /* @__PURE__ */ jsx(PoolseIcon, { name: icon, size: large ? 30 : 25, color: iconColor, label: null })
|
|
8496
8824
|
}
|
|
8497
8825
|
),
|
|
8498
|
-
label ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style:
|
|
8826
|
+
label ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles34.label, children: label }) : null
|
|
8499
8827
|
] });
|
|
8500
8828
|
}
|
|
8501
|
-
var
|
|
8829
|
+
var styles34 = StyleSheet.create({
|
|
8502
8830
|
// Fixed width so captions of different lengths cannot shift the row.
|
|
8503
8831
|
slot: { width: 76, alignItems: "center", gap: 7 },
|
|
8504
8832
|
button: { alignItems: "center", justifyContent: "center" },
|
|
@@ -8511,7 +8839,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8511
8839
|
View,
|
|
8512
8840
|
{
|
|
8513
8841
|
style: [
|
|
8514
|
-
|
|
8842
|
+
styles35.ring,
|
|
8515
8843
|
{
|
|
8516
8844
|
width: outer,
|
|
8517
8845
|
height: outer,
|
|
@@ -8524,7 +8852,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8524
8852
|
View,
|
|
8525
8853
|
{
|
|
8526
8854
|
style: [
|
|
8527
|
-
|
|
8855
|
+
styles35.circle,
|
|
8528
8856
|
{
|
|
8529
8857
|
width: size,
|
|
8530
8858
|
height: size,
|
|
@@ -8535,7 +8863,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
|
|
|
8535
8863
|
children: /* @__PURE__ */ jsx(
|
|
8536
8864
|
Text,
|
|
8537
8865
|
{
|
|
8538
|
-
style: [
|
|
8866
|
+
style: [styles35.initials, { fontSize: Math.round(size * 0.38) }],
|
|
8539
8867
|
numberOfLines: 1,
|
|
8540
8868
|
allowFontScaling: false,
|
|
8541
8869
|
children: initialsOf(name)
|
|
@@ -8552,7 +8880,7 @@ function initialsOf(name) {
|
|
|
8552
8880
|
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
8553
8881
|
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
8554
8882
|
}
|
|
8555
|
-
var
|
|
8883
|
+
var styles35 = StyleSheet.create({
|
|
8556
8884
|
ring: { alignItems: "center", justifyContent: "center" },
|
|
8557
8885
|
circle: { alignItems: "center", justifyContent: "center" },
|
|
8558
8886
|
initials: { color: "#ffffff", fontWeight: "600" }
|
|
@@ -8580,15 +8908,15 @@ function AudioRouteSheet({
|
|
|
8580
8908
|
animationType: "fade",
|
|
8581
8909
|
onRequestClose: onClose,
|
|
8582
8910
|
...EDGE_TO_EDGE_MODAL,
|
|
8583
|
-
children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
8911
|
+
children: /* @__PURE__ */ jsx(Pressable, { style: styles36.backdrop, onPress: onClose, accessibilityRole: "button", children: /* @__PURE__ */ jsxs(
|
|
8584
8912
|
Pressable,
|
|
8585
8913
|
{
|
|
8586
|
-
style: [
|
|
8914
|
+
style: [styles36.sheet, { paddingBottom: Math.max(34, insets.bottom + 16) }],
|
|
8587
8915
|
onPress: () => {
|
|
8588
8916
|
},
|
|
8589
8917
|
children: [
|
|
8590
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
8591
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
8918
|
+
/* @__PURE__ */ jsx(View, { style: styles36.grabber }),
|
|
8919
|
+
/* @__PURE__ */ jsx(Text, { style: styles36.title, children: "Audio output" }),
|
|
8592
8920
|
routes.map((route) => {
|
|
8593
8921
|
const selected = route.id === selectedRouteId;
|
|
8594
8922
|
return /* @__PURE__ */ jsxs(
|
|
@@ -8600,7 +8928,7 @@ function AudioRouteSheet({
|
|
|
8600
8928
|
},
|
|
8601
8929
|
accessibilityRole: "button",
|
|
8602
8930
|
accessibilityState: { selected },
|
|
8603
|
-
style: ({ pressed }) => [
|
|
8931
|
+
style: ({ pressed }) => [styles36.row, pressed && styles36.rowPressed],
|
|
8604
8932
|
children: [
|
|
8605
8933
|
/* @__PURE__ */ jsx(
|
|
8606
8934
|
PoolseIcon,
|
|
@@ -8611,7 +8939,7 @@ function AudioRouteSheet({
|
|
|
8611
8939
|
label: null
|
|
8612
8940
|
}
|
|
8613
8941
|
),
|
|
8614
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
8942
|
+
/* @__PURE__ */ jsx(Text, { style: [styles36.label, selected && styles36.labelSelected], children: route.label }),
|
|
8615
8943
|
selected && /* @__PURE__ */ jsx(PoolseIcon, { name: "check", size: 19, color: callColors.accept, label: "selected" })
|
|
8616
8944
|
]
|
|
8617
8945
|
},
|
|
@@ -8624,7 +8952,7 @@ function AudioRouteSheet({
|
|
|
8624
8952
|
}
|
|
8625
8953
|
);
|
|
8626
8954
|
}
|
|
8627
|
-
var
|
|
8955
|
+
var styles36 = StyleSheet.create({
|
|
8628
8956
|
backdrop: { flex: 1, backgroundColor: "rgba(0,0,0,0.55)", justifyContent: "flex-end" },
|
|
8629
8957
|
sheet: {
|
|
8630
8958
|
backgroundColor: callColors.tile,
|
|
@@ -8684,6 +9012,6 @@ function format(total) {
|
|
|
8684
9012
|
return `${hours > 0 ? `${hours}:` : ""}${mm}:${String(seconds).padStart(2, "0")}`;
|
|
8685
9013
|
}
|
|
8686
9014
|
|
|
8687
|
-
export { AttachmentPicker, AttachmentPreview, AudioRouteSheet, Avatar, CallAvatar, CallControlButton, CallLogRow, ChatHeader, ConversationList, ConversationView, DaySeparator, EditHistorySheet, EmojiPicker, GroupDetailsSheet, ImageMosaic, LinkPreviewCard, LiveCallBanner, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, MessageList, MessageRow, NewMessagesDivider, PoolseIcon, PoolseInbox, PoolseLogo, PoolseTheme, PresenceBadge, primitives as Primitives, ReactionPicker, ReactionStrip, ThreadSummary, ThreadView, TypingIndicator, UploadQueueStrip, UserName, callColors, defaultDarkTheme, defaultLightTheme, useAppStateLifecycle, useAppStatePresence, useCallDuration, useDisplayName, usePoolseTheme, useTheme };
|
|
9015
|
+
export { AttachmentPicker, AttachmentPreview, AudioRouteSheet, Avatar, CallAvatar, CallControlButton, CallLogRow, ChatHeader, ConversationList, ConversationView, DaySeparator, EditHistorySheet, EmojiPicker, EmptyState, GroupDetailsSheet, ImageMosaic, LinkPreviewCard, LiveCallBanner, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, MessageList, MessageRow, NewMessagesDivider, PoolseIcon, PoolseInbox, PoolseLogo, PoolseTheme, PresenceBadge, primitives as Primitives, ReactionPicker, ReactionStrip, SendStatus, ThreadSummary, ThreadView, TypingIndicator, UploadQueueStrip, UserName, applyBackground, callColors, defaultDarkTheme, defaultLightTheme, useAppStateLifecycle, useAppStatePresence, useBackgroundClients, useCallDuration, useDisplayName, usePoolseTheme, useTheme };
|
|
8688
9016
|
//# sourceMappingURL=index.js.map
|
|
8689
9017
|
//# sourceMappingURL=index.js.map
|