@poolse/react-native 3.3.0 → 3.4.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/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { useUser, useMe, useConversations, formatCallLogPreview, useAttachmentUpload, useConversation, useMembers, usePresence, receiptsOf, useMessages, useTyping, useMessageStreams, useRealtimeStatus, isMessageVisibleTo, computeGroupPosition, canEditOwnMessage, formatDayLabel, callLogDisplayFor, useLiveCall, sameDay, useReactions, useThread, useAttachmentUrl, usePoolse } from '@poolse/react';
2
2
  import { createContext, forwardRef, useRef, useState, useImperativeHandle, useEffect, useMemo, useCallback, useContext, createElement } from 'react';
3
- import { StyleSheet, View, Pressable, TextInput, Text, useWindowDimensions, Animated, Easing, PanResponder, Image, Keyboard, Platform, ScrollView, ActivityIndicator, FlatList, AppState, KeyboardAvoidingView, Modal, Linking } from 'react-native';
3
+ import { StyleSheet, View, Pressable, TextInput, Text, useWindowDimensions, Animated, Easing, PanResponder, Image, Keyboard, Platform, ScrollView, ActivityIndicator, FlatList, AppState, KeyboardAvoidingView, Modal, Linking, useColorScheme } from 'react-native';
4
+ import { toNativeTheme, isBuiltInThemeId } from '@poolse/theme';
4
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
6
  import { SvgXml, Svg, Path, Circle, G } from 'react-native-svg';
6
7
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -152,28 +153,172 @@ var defaultDarkTheme = {
152
153
  spacing,
153
154
  shadows: darkShadows
154
155
  };
155
- var ThemeContext = createContext(null);
156
- function PoolseTheme({ mode, theme, children }) {
157
- const resolved = useMemo(() => {
158
- const base = (mode ?? theme?.mode) === "dark" ? defaultDarkTheme : defaultLightTheme;
159
- if (!theme) return base;
160
- return {
161
- mode: theme.mode ?? base.mode,
162
- colors: { ...base.colors, ...theme.colors },
163
- type: { ...base.type, ...theme.type },
164
- radii: { ...base.radii, ...theme.radii },
165
- spacing: { ...base.spacing, ...theme.spacing },
166
- shadows: {
167
- sm: { ...base.shadows.sm, ...theme.shadows?.sm },
168
- md: { ...base.shadows.md, ...theme.shadows?.md },
169
- lg: { ...base.shadows.lg, ...theme.shadows?.lg }
156
+ function legacyToNative(l) {
157
+ const c = l.colors;
158
+ return {
159
+ id: "default",
160
+ name: "Default",
161
+ scheme: l.mode,
162
+ colors: {
163
+ background: c.paper,
164
+ surface: c.surface,
165
+ surfaceAlt: c.surface2,
166
+ text: c.ink,
167
+ textMuted: c.ink2,
168
+ textSubtle: c.ink3,
169
+ border: c.border,
170
+ accent: c.brand,
171
+ accentText: c.onBrand,
172
+ accentSoft: c.brandSoft,
173
+ accentStrong: c.brandStrong,
174
+ // Links in other people's bubbles have always been brand-coloured.
175
+ link: c.brand,
176
+ sidebar: c.surface2,
177
+ sidebarText: c.ink,
178
+ sidebarActive: c.brandSoft,
179
+ sidebarActiveText: c.brandStrong,
180
+ badge: c.unreadPill,
181
+ badgeText: c.unreadPillText,
182
+ mention: c.brandSoft,
183
+ mentionText: c.brandStrong,
184
+ danger: c.error,
185
+ warning: c.warning,
186
+ success: c.success,
187
+ info: c.info,
188
+ presence: c.presence,
189
+ ownBubble: c.selfBubble,
190
+ ownBubbleText: c.selfBubbleText,
191
+ otherBubble: c.otherBubble,
192
+ otherBubbleText: c.otherBubbleText,
193
+ overlay: "#00000073"
194
+ },
195
+ fonts: {
196
+ body: l.type.fontBody,
197
+ display: l.type.fontDisplay,
198
+ mono: l.type.fontMono,
199
+ sizeXs: 11,
200
+ sizeSm: 13,
201
+ sizeMd: l.type.bodySize,
202
+ sizeLg: 17,
203
+ sizeXl: 20,
204
+ lineHeight: l.type.lineHeight
205
+ },
206
+ radii: { ...l.radii },
207
+ spacing: { ...l.spacing },
208
+ shadows: { sm: l.shadows.sm, md: l.shadows.md, lg: l.shadows.lg }
209
+ };
210
+ }
211
+ function nativeToLegacy(n) {
212
+ const c = n.colors;
213
+ return {
214
+ mode: n.scheme,
215
+ colors: {
216
+ brand: c.accent,
217
+ brandStrong: c.accentStrong,
218
+ brandSoft: c.accentSoft,
219
+ onBrand: c.accentText,
220
+ paper: c.background,
221
+ surface: c.surface,
222
+ surface2: c.surfaceAlt,
223
+ ink: c.text,
224
+ ink2: c.textMuted,
225
+ ink3: c.textSubtle,
226
+ border: c.border,
227
+ presence: c.presence,
228
+ success: c.success,
229
+ warning: c.warning,
230
+ error: c.danger,
231
+ info: c.info,
232
+ selfBubble: c.ownBubble,
233
+ selfBubbleText: c.ownBubbleText,
234
+ otherBubble: c.otherBubble,
235
+ otherBubbleText: c.otherBubbleText,
236
+ unreadPill: c.badge,
237
+ unreadPillText: c.badgeText
238
+ },
239
+ type: {
240
+ ...type,
241
+ fontDisplay: n.fonts.display,
242
+ fontBody: n.fonts.body,
243
+ fontMono: n.fonts.mono,
244
+ bodySize: n.fonts.sizeMd,
245
+ lineHeight: n.fonts.lineHeight
246
+ },
247
+ radii: { ...n.radii },
248
+ spacing: { ...n.spacing },
249
+ shadows: { ...n.shadows }
250
+ };
251
+ }
252
+ function isTheme(value) {
253
+ return typeof value === "object" && value !== null && "light" in value && "dark" in value && "id" in value;
254
+ }
255
+ function mergeLegacy(base, theme) {
256
+ return {
257
+ mode: theme.mode ?? base.mode,
258
+ colors: { ...base.colors, ...theme.colors },
259
+ type: { ...base.type, ...theme.type },
260
+ radii: { ...base.radii, ...theme.radii },
261
+ spacing: { ...base.spacing, ...theme.spacing },
262
+ shadows: {
263
+ sm: { ...base.shadows.sm, ...theme.shadows?.sm },
264
+ md: { ...base.shadows.md, ...theme.shadows?.md },
265
+ lg: { ...base.shadows.lg, ...theme.shadows?.lg }
266
+ }
267
+ };
268
+ }
269
+ function isNamedTheme(theme) {
270
+ return isBuiltInThemeId(theme) || isTheme(theme);
271
+ }
272
+ function selectedScheme(selection, system) {
273
+ const { theme } = selection;
274
+ const named = isNamedTheme(theme);
275
+ const legacyMode = !named && theme ? theme.mode : void 0;
276
+ const preference = selection.colorScheme ?? selection.mode ?? legacyMode ?? (named ? "system" : "light");
277
+ return preference === "system" ? system : preference;
278
+ }
279
+ function resolveThemeValue(selection, scheme) {
280
+ const { theme, fonts } = selection;
281
+ if (isNamedTheme(theme)) {
282
+ const native = toNativeTheme(theme, scheme, {
283
+ fonts: {
284
+ ...fonts?.body ? { body: fonts.body } : {},
285
+ ...fonts?.display ? { display: fonts.display } : {},
286
+ ...fonts?.mono ? { mono: fonts.mono } : {}
170
287
  }
171
- };
172
- }, [mode, theme]);
173
- return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: resolved, children });
288
+ });
289
+ return { native, legacy: nativeToLegacy(native) };
290
+ }
291
+ const base = scheme === "dark" ? defaultDarkTheme : defaultLightTheme;
292
+ const legacy = theme ? { ...mergeLegacy(base, theme), mode: scheme } : base;
293
+ return { native: legacyToNative(legacy), legacy };
294
+ }
295
+ var ThemeContext = createContext(null);
296
+ var FALLBACK = {
297
+ native: legacyToNative(defaultLightTheme)};
298
+ function PoolseTheme({ theme, colorScheme, mode, fonts, children }) {
299
+ const system = useColorScheme() === "dark" ? "dark" : "light";
300
+ const scheme = selectedScheme({ theme, colorScheme, mode }, system);
301
+ const fontBody = fonts?.body;
302
+ const fontDisplay = fonts?.display;
303
+ const fontMono = fonts?.mono;
304
+ const value = useMemo(
305
+ () => resolveThemeValue(
306
+ {
307
+ theme,
308
+ fonts: {
309
+ ...fontBody ? { body: fontBody } : {},
310
+ ...fontDisplay ? { display: fontDisplay } : {},
311
+ ...fontMono ? { mono: fontMono } : {}
312
+ }
313
+ },
314
+ scheme
315
+ ),
316
+ [theme, scheme, fontBody, fontDisplay, fontMono]
317
+ );
318
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
174
319
  }
175
- function usePoolseTheme() {
176
- return useContext(ThemeContext) ?? defaultLightTheme;
320
+ function useTheme() {
321
+ return (useContext(ThemeContext) ?? FALLBACK).native;
177
322
  }
178
323
 
179
324
  // src/primitives/userColor.ts
@@ -202,13 +347,13 @@ function userColor(id) {
202
347
  }
203
348
  return PALETTE[Math.abs(h) % PALETTE.length];
204
349
  }
205
- var SIZES = { sm: 28, md: 40, lg: 56 };
350
+ var SIZES = { xs: 20, sm: 28, md: 40, lg: 56 };
206
351
  function Avatar({ src, name, seed, online, size = "md" }) {
207
- const theme = usePoolseTheme();
352
+ const theme = useTheme();
208
353
  const dim = SIZES[size];
209
354
  const initials = computeInitials(name);
210
- const tint = seed ? userColor(seed) : theme.colors.brand;
211
- const fontSize = size === "sm" ? 11 : size === "lg" ? 22 : 15;
355
+ const tint = seed ? userColor(seed) : theme.colors.accent;
356
+ const fontSize = size === "xs" ? 9 : size === "sm" ? 11 : size === "lg" ? 22 : 15;
212
357
  return /* @__PURE__ */ jsxs(
213
358
  View,
214
359
  {
@@ -235,10 +380,10 @@ function Avatar({ src, name, seed, online, size = "md" }) {
235
380
  Text,
236
381
  {
237
382
  style: {
238
- color: theme.colors.onBrand,
383
+ color: theme.colors.accentText,
239
384
  fontSize,
240
385
  fontWeight: "600",
241
- fontFamily: theme.type.fontBody
386
+ fontFamily: theme.fonts.body
242
387
  },
243
388
  children: initials
244
389
  }
@@ -545,10 +690,10 @@ var ICONS = {
545
690
  }
546
691
  };
547
692
  function PoolseIcon({ name, size = 20, color, label }) {
548
- const theme = usePoolseTheme();
693
+ const theme = useTheme();
549
694
  const def = ICONS[name];
550
695
  if (!def) return null;
551
- const stroke = color ?? theme.colors.ink;
696
+ const stroke = color ?? theme.colors.text;
552
697
  const xml = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${def.vb}" fill="none" stroke="${stroke}" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">${def.d}</svg>`;
553
698
  const a11y = label === null ? { accessibilityRole: "none" } : { accessibilityRole: "image", accessibilityLabel: label ?? name };
554
699
  return /* @__PURE__ */ jsx(SvgXml, { xml, width: size, height: size, ...a11y });
@@ -562,30 +707,30 @@ function MemberList({
562
707
  renderItem,
563
708
  emptyState
564
709
  }) {
565
- const theme = usePoolseTheme();
710
+ const theme = useTheme();
566
711
  const { members, loading, error, removeMember } = useMembers(conversationId);
567
712
  const { online: presenceOnline } = usePresence(
568
713
  onlineExternalIds === void 0 ? conversationId : ""
569
714
  );
570
715
  const effectiveOnline = onlineExternalIds ?? presenceOnline;
571
716
  if (loading && members.length === 0) {
572
- return /* @__PURE__ */ jsx(View, { style: [styles2.placeholder, { backgroundColor: theme.colors.paper }], children: /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.brand }) });
717
+ return /* @__PURE__ */ jsx(View, { style: [styles2.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.accent }) });
573
718
  }
574
719
  if (error) {
575
- return /* @__PURE__ */ jsxs(View, { style: [styles2.placeholder, { backgroundColor: theme.colors.paper }], children: [
576
- /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.error, fontFamily: theme.type.fontBody }, children: "Failed to load members." }),
577
- error.message ? /* @__PURE__ */ jsx(Text, { style: [styles2.errorDetail, { color: theme.colors.ink3 }], children: error.message }) : null
720
+ return /* @__PURE__ */ jsxs(View, { style: [styles2.placeholder, { backgroundColor: theme.colors.background }], children: [
721
+ /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.danger, fontFamily: theme.fonts.body }, children: "Failed to load members." }),
722
+ error.message ? /* @__PURE__ */ jsx(Text, { style: [styles2.errorDetail, { color: theme.colors.textSubtle }], children: error.message }) : null
578
723
  ] });
579
724
  }
580
725
  if (members.length === 0) {
581
- return /* @__PURE__ */ jsx(View, { style: [styles2.placeholder, { backgroundColor: theme.colors.paper }], children: typeof emptyState === "string" || emptyState == null ? /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.ink3, fontFamily: theme.type.fontBody }, children: emptyState ?? "No members." }) : emptyState });
726
+ return /* @__PURE__ */ jsx(View, { style: [styles2.placeholder, { backgroundColor: theme.colors.background }], children: typeof emptyState === "string" || emptyState == null ? /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState ?? "No members." }) : emptyState });
582
727
  }
583
728
  return /* @__PURE__ */ jsx(
584
729
  FlatList,
585
730
  {
586
731
  data: members,
587
732
  keyExtractor: (m) => m.user_id,
588
- style: { backgroundColor: theme.colors.paper },
733
+ style: { backgroundColor: theme.colors.background },
589
734
  renderItem: ({ item }) => {
590
735
  if (renderItem) return /* @__PURE__ */ jsx(Fragment, { children: renderItem(item) });
591
736
  const isOnline = effectiveOnline.has(item.external_id);
@@ -613,7 +758,7 @@ function MemberRow({
613
758
  avatarFor,
614
759
  onRemove
615
760
  }) {
616
- const theme = usePoolseTheme();
761
+ const theme = useTheme();
617
762
  const resolved = useUser(externalId);
618
763
  const name = labelFor?.(externalId) ?? resolved.profile?.displayName ?? externalId;
619
764
  const avatarUrl = avatarFor?.(externalId) ?? resolved.profile?.avatarUrl ?? null;
@@ -623,14 +768,14 @@ function MemberRow({
623
768
  /* @__PURE__ */ jsx(
624
769
  Text,
625
770
  {
626
- style: [styles2.name, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
771
+ style: [styles2.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
627
772
  numberOfLines: 1,
628
773
  children: name
629
774
  }
630
775
  ),
631
- /* @__PURE__ */ jsx(Text, { style: [styles2.role, { color: theme.colors.ink3 }], children: role })
776
+ /* @__PURE__ */ jsx(Text, { style: [styles2.role, { color: theme.colors.textSubtle }], children: role })
632
777
  ] }),
633
- onRemove ? /* @__PURE__ */ jsx(Pressable, { onPress: onRemove, hitSlop: 8, style: styles2.removeBtn, children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.ink2 }) }) : null
778
+ onRemove ? /* @__PURE__ */ jsx(Pressable, { onPress: onRemove, hitSlop: 8, style: styles2.removeBtn, children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
634
779
  ] });
635
780
  }
636
781
  var styles2 = StyleSheet.create({
@@ -725,7 +870,7 @@ function GroupDetailsSheet({
725
870
  avatarFor,
726
871
  canRemoveMember
727
872
  }) {
728
- const theme = usePoolseTheme();
873
+ const theme = useTheme();
729
874
  const { conversation } = useConversation(conversationId);
730
875
  const { members } = useMembers(conversationId);
731
876
  const insets = useSafeInsets();
@@ -759,7 +904,7 @@ function GroupDetailsSheet({
759
904
  style: [
760
905
  styles3.sheet,
761
906
  {
762
- backgroundColor: theme.colors.paper,
907
+ backgroundColor: theme.colors.background,
763
908
  borderTopLeftRadius: theme.radii.xl,
764
909
  borderTopRightRadius: theme.radii.xl,
765
910
  // Header stays below the status bar even on short screens.
@@ -772,16 +917,16 @@ function GroupDetailsSheet({
772
917
  theme.shadows.lg
773
918
  ],
774
919
  children: [
775
- /* @__PURE__ */ jsx(View, { ...panHandlers, style: styles3.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles3.dragPill, { backgroundColor: theme.colors.ink3 }] }) }),
920
+ /* @__PURE__ */ jsx(View, { ...panHandlers, style: styles3.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles3.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
776
921
  /* @__PURE__ */ jsxs(View, { style: styles3.headerRow, children: [
777
922
  /* @__PURE__ */ jsx(
778
923
  Pressable,
779
924
  {
780
925
  onPress: onClose,
781
926
  hitSlop: 16,
782
- style: [styles3.closeBtn, { backgroundColor: theme.colors.surface2 }],
927
+ style: [styles3.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
783
928
  accessibilityLabel: "Close",
784
- children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.ink })
929
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
785
930
  }
786
931
  ),
787
932
  /* @__PURE__ */ jsx(
@@ -789,7 +934,7 @@ function GroupDetailsSheet({
789
934
  {
790
935
  style: [
791
936
  styles3.headerTitle,
792
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
937
+ { color: theme.colors.text, fontFamily: theme.fonts.display }
793
938
  ],
794
939
  children: "Group details"
795
940
  }
@@ -800,15 +945,12 @@ function GroupDetailsSheet({
800
945
  /* @__PURE__ */ jsx(
801
946
  Text,
802
947
  {
803
- style: [
804
- styles3.title,
805
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
806
- ],
948
+ style: [styles3.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
807
949
  numberOfLines: 1,
808
950
  children: title
809
951
  }
810
952
  ),
811
- /* @__PURE__ */ jsx(Text, { style: [styles3.subtitle, { color: theme.colors.ink3 }], children: subtitle })
953
+ /* @__PURE__ */ jsx(Text, { style: [styles3.subtitle, { color: theme.colors.textSubtle }], children: subtitle })
812
954
  ] }),
813
955
  /* @__PURE__ */ jsx(View, { style: [styles3.divider, { backgroundColor: theme.colors.border }] }),
814
956
  /* @__PURE__ */ jsx(View, { style: styles3.sectionLabelRow, children: /* @__PURE__ */ jsx(
@@ -816,7 +958,7 @@ function GroupDetailsSheet({
816
958
  {
817
959
  style: [
818
960
  styles3.sectionLabel,
819
- { color: theme.colors.ink2, fontFamily: theme.type.fontBody }
961
+ { color: theme.colors.textMuted, fontFamily: theme.fonts.body }
820
962
  ],
821
963
  children: "Members"
822
964
  }
@@ -917,7 +1059,7 @@ function ChatHeader({
917
1059
  onPress,
918
1060
  onBack
919
1061
  }) {
920
- const theme = usePoolseTheme();
1062
+ const theme = useTheme();
921
1063
  const { conversation } = useConversation(conversationId);
922
1064
  const { members } = useMembers(conversationId);
923
1065
  const { me } = useMe();
@@ -964,18 +1106,18 @@ function ChatHeader({
964
1106
  }
965
1107
  ],
966
1108
  children: [
967
- onBack ? /* @__PURE__ */ jsx(Pressable, { onPress: onBack, hitSlop: 12, style: styles4.backBtn, accessibilityLabel: "Back", children: /* @__PURE__ */ jsx(PoolseIcon, { name: "reply", size: 20, color: theme.colors.ink }) }) : null,
1109
+ onBack ? /* @__PURE__ */ jsx(Pressable, { onPress: onBack, hitSlop: 12, style: styles4.backBtn, accessibilityLabel: "Back", children: /* @__PURE__ */ jsx(PoolseIcon, { name: "reply", size: 20, color: theme.colors.text }) }) : null,
968
1110
  /* @__PURE__ */ jsx(Avatar, { src: avatarUrl, name: title, seed: avatarSeed, online: isOnline, size: "md" }),
969
1111
  /* @__PURE__ */ jsxs(View, { style: styles4.titleCol, children: [
970
1112
  /* @__PURE__ */ jsx(
971
1113
  Text,
972
1114
  {
973
- style: [styles4.title, { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }],
1115
+ style: [styles4.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
974
1116
  numberOfLines: 1,
975
1117
  children: title
976
1118
  }
977
1119
  ),
978
- subtitle ? /* @__PURE__ */ jsx(Text, { style: [styles4.subtitle, { color: theme.colors.ink3 }], numberOfLines: 1, children: subtitle }) : null
1120
+ subtitle ? /* @__PURE__ */ jsx(Text, { style: [styles4.subtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: subtitle }) : null
979
1121
  ] }),
980
1122
  onMembersPress ? /* @__PURE__ */ jsx(
981
1123
  Pressable,
@@ -984,7 +1126,7 @@ function ChatHeader({
984
1126
  hitSlop: 12,
985
1127
  style: styles4.actionBtn,
986
1128
  accessibilityLabel: "Show members",
987
- children: /* @__PURE__ */ jsx(PoolseIcon, { name: "users", size: 20, color: theme.colors.ink2 })
1129
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: "users", size: 20, color: theme.colors.textMuted })
988
1130
  }
989
1131
  ) : null
990
1132
  ]
@@ -1050,7 +1192,7 @@ function ConversationList({
1050
1192
  labelFor,
1051
1193
  avatarFor
1052
1194
  }) {
1053
- const theme = usePoolseTheme();
1195
+ const theme = useTheme();
1054
1196
  const auto = useConversations();
1055
1197
  const { me } = useMe();
1056
1198
  const meExternalId = me?.external_id ?? null;
@@ -1061,20 +1203,20 @@ function ConversationList({
1061
1203
  const error = isControlled ? controlledError ?? null : auto.error;
1062
1204
  const counts = unreadCounts ?? (isControlled ? void 0 : auto.unreadCounts);
1063
1205
  if (loading && conversations.length === 0) {
1064
- return /* @__PURE__ */ jsx(View, { style: [styles5.placeholder, { backgroundColor: theme.colors.paper }], children: /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.brand }) });
1206
+ return /* @__PURE__ */ jsx(View, { style: [styles5.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.accent }) });
1065
1207
  }
1066
1208
  if (error) {
1067
- return /* @__PURE__ */ jsx(View, { style: [styles5.placeholder, { backgroundColor: theme.colors.paper }], children: /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.error, fontFamily: theme.type.fontBody }, children: "Failed to load conversations." }) });
1209
+ return /* @__PURE__ */ jsx(View, { style: [styles5.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.danger, fontFamily: theme.fonts.body }, children: "Failed to load conversations." }) });
1068
1210
  }
1069
1211
  if (conversations.length === 0) {
1070
- return /* @__PURE__ */ jsx(View, { style: [styles5.placeholder, { backgroundColor: theme.colors.paper }], children: typeof emptyState === "string" || emptyState == null ? /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.ink3, fontFamily: theme.type.fontBody }, children: emptyState ?? "No conversations yet." }) : emptyState });
1212
+ return /* @__PURE__ */ jsx(View, { style: [styles5.placeholder, { backgroundColor: theme.colors.background }], children: typeof emptyState === "string" || emptyState == null ? /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState ?? "No conversations yet." }) : emptyState });
1071
1213
  }
1072
1214
  return /* @__PURE__ */ jsx(
1073
1215
  FlatList,
1074
1216
  {
1075
1217
  data: conversations,
1076
1218
  keyExtractor: (c) => c.id,
1077
- style: { backgroundColor: theme.colors.paper },
1219
+ style: { backgroundColor: theme.colors.background },
1078
1220
  renderItem: ({ item }) => {
1079
1221
  const selected = selectedId === item.id;
1080
1222
  if (renderItem) {
@@ -1107,7 +1249,7 @@ function ConversationRow({
1107
1249
  avatarFor,
1108
1250
  onSelect
1109
1251
  }) {
1110
- const theme = usePoolseTheme();
1252
+ const theme = useTheme();
1111
1253
  const isDirect = conv.type === "direct";
1112
1254
  const otherExtId = isDirect && meExternalId ? (conv.member_external_ids ?? []).find((x) => x !== meExternalId) ?? null : null;
1113
1255
  const resolvedOther = useUser(isDirect ? otherExtId : null);
@@ -1121,7 +1263,7 @@ function ConversationRow({
1121
1263
  style: [
1122
1264
  styles5.row,
1123
1265
  {
1124
- backgroundColor: selected ? theme.colors.surface2 : "transparent"
1266
+ backgroundColor: selected ? theme.colors.surfaceAlt : "transparent"
1125
1267
  }
1126
1268
  ],
1127
1269
  children: [
@@ -1130,14 +1272,14 @@ function ConversationRow({
1130
1272
  /* @__PURE__ */ jsx(
1131
1273
  Text,
1132
1274
  {
1133
- style: [styles5.name, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
1275
+ style: [styles5.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
1134
1276
  numberOfLines: 1,
1135
1277
  children: title
1136
1278
  }
1137
1279
  ),
1138
- conv.last_message_preview ? /* @__PURE__ */ jsx(Text, { style: [styles5.preview, { color: theme.colors.ink3 }], numberOfLines: 1, children: formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview }) : conv.last_message_at ? /* @__PURE__ */ jsx(Text, { style: [styles5.preview, { color: theme.colors.ink3 }], numberOfLines: 1, children: formatRelative(conv.last_message_at) }) : null
1280
+ conv.last_message_preview ? /* @__PURE__ */ jsx(Text, { style: [styles5.preview, { color: theme.colors.textSubtle }], numberOfLines: 1, children: formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview }) : conv.last_message_at ? /* @__PURE__ */ jsx(Text, { style: [styles5.preview, { color: theme.colors.textSubtle }], numberOfLines: 1, children: formatRelative(conv.last_message_at) }) : null
1139
1281
  ] }),
1140
- unread > 0 ? /* @__PURE__ */ jsx(View, { style: [styles5.unreadPill, { backgroundColor: theme.colors.unreadPill }], children: /* @__PURE__ */ jsx(Text, { style: [styles5.unreadText, { color: theme.colors.unreadPillText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
1282
+ unread > 0 ? /* @__PURE__ */ jsx(View, { style: [styles5.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsx(Text, { style: [styles5.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
1141
1283
  ]
1142
1284
  }
1143
1285
  );
@@ -1228,7 +1370,7 @@ function AttachmentPicker({
1228
1370
  onPickInputs,
1229
1371
  camera = true
1230
1372
  }) {
1231
- const theme = usePoolseTheme();
1373
+ const theme = useTheme();
1232
1374
  const insets = useSafeInsets();
1233
1375
  const upload = useSharedUpload();
1234
1376
  const { setPreview } = useUploadPreview();
@@ -1275,18 +1417,18 @@ function AttachmentPicker({
1275
1417
  ],
1276
1418
  children: [
1277
1419
  camera ? /* @__PURE__ */ jsxs(Pressable, { style: styles6.item, onPress: () => pickFromKind("camera"), children: [
1278
- /* @__PURE__ */ jsx(PoolseIcon, { name: "camera", size: 20, color: theme.colors.ink2 }),
1279
- /* @__PURE__ */ jsx(Text, { style: [styles6.itemText, { color: theme.colors.ink }], children: "Camera" })
1420
+ /* @__PURE__ */ jsx(PoolseIcon, { name: "camera", size: 20, color: theme.colors.textMuted }),
1421
+ /* @__PURE__ */ jsx(Text, { style: [styles6.itemText, { color: theme.colors.text }], children: "Camera" })
1280
1422
  ] }) : null,
1281
1423
  /* @__PURE__ */ jsxs(Pressable, { style: styles6.item, onPress: () => pickFromKind("image"), children: [
1282
- /* @__PURE__ */ jsx(PoolseIcon, { name: "image", size: 20, color: theme.colors.ink2 }),
1283
- /* @__PURE__ */ jsx(Text, { style: [styles6.itemText, { color: theme.colors.ink }], children: "Photo or video" })
1424
+ /* @__PURE__ */ jsx(PoolseIcon, { name: "image", size: 20, color: theme.colors.textMuted }),
1425
+ /* @__PURE__ */ jsx(Text, { style: [styles6.itemText, { color: theme.colors.text }], children: "Photo or video" })
1284
1426
  ] }),
1285
1427
  /* @__PURE__ */ jsxs(Pressable, { style: styles6.item, onPress: () => pickFromKind("document"), children: [
1286
- /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 20, color: theme.colors.ink2 }),
1287
- /* @__PURE__ */ jsx(Text, { style: [styles6.itemText, { color: theme.colors.ink }], children: "File" })
1428
+ /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 20, color: theme.colors.textMuted }),
1429
+ /* @__PURE__ */ jsx(Text, { style: [styles6.itemText, { color: theme.colors.text }], children: "File" })
1288
1430
  ] }),
1289
- /* @__PURE__ */ jsx(Pressable, { style: styles6.cancel, onPress: onClose, children: /* @__PURE__ */ jsx(Text, { style: [styles6.itemText, { color: theme.colors.brand }], children: "Cancel" }) })
1431
+ /* @__PURE__ */ jsx(Pressable, { style: styles6.cancel, onPress: onClose, children: /* @__PURE__ */ jsx(Text, { style: [styles6.itemText, { color: theme.colors.accent }], children: "Cancel" }) })
1290
1432
  ]
1291
1433
  }
1292
1434
  ) })
@@ -1464,39 +1606,53 @@ var styles6 = StyleSheet.create({
1464
1606
  fontWeight: "500"
1465
1607
  }
1466
1608
  });
1467
- function DaySeparator({ label }) {
1468
- const theme = usePoolseTheme();
1469
- return /* @__PURE__ */ jsx(View, { style: styles7.wrap, children: /* @__PURE__ */ jsx(
1470
- View,
1471
- {
1472
- style: [
1473
- styles7.chip,
1474
- {
1475
- backgroundColor: theme.colors.surface2,
1476
- borderColor: theme.colors.border
1477
- }
1478
- ],
1479
- children: /* @__PURE__ */ jsx(
1480
- Text,
1481
- {
1482
- style: [
1483
- styles7.label,
1484
- {
1485
- color: theme.colors.ink2,
1486
- fontFamily: theme.type.fontBody
1487
- }
1488
- ],
1489
- children: label
1490
- }
1491
- )
1492
- }
1493
- ) });
1609
+ function DaySeparator({ label, variant = "pill" }) {
1610
+ const theme = useTheme();
1611
+ const rule = variant === "rule" ? /* @__PURE__ */ jsx(View, { style: [styles7.rule, { backgroundColor: theme.colors.border }] }) : null;
1612
+ return /* @__PURE__ */ jsxs(View, { style: [styles7.wrap, rule ? styles7.wrapRule : null], children: [
1613
+ rule,
1614
+ /* @__PURE__ */ jsx(
1615
+ View,
1616
+ {
1617
+ style: [
1618
+ styles7.chip,
1619
+ {
1620
+ backgroundColor: theme.colors.surfaceAlt,
1621
+ borderColor: theme.colors.border
1622
+ }
1623
+ ],
1624
+ children: /* @__PURE__ */ jsx(
1625
+ Text,
1626
+ {
1627
+ style: [
1628
+ styles7.label,
1629
+ {
1630
+ color: theme.colors.textMuted,
1631
+ fontFamily: theme.fonts.body
1632
+ }
1633
+ ],
1634
+ children: label
1635
+ }
1636
+ )
1637
+ }
1638
+ ),
1639
+ rule
1640
+ ] });
1494
1641
  }
1495
1642
  var styles7 = StyleSheet.create({
1496
1643
  wrap: {
1497
1644
  alignItems: "center",
1498
1645
  marginVertical: 8
1499
1646
  },
1647
+ wrapRule: {
1648
+ flexDirection: "row",
1649
+ gap: 10,
1650
+ paddingHorizontal: 12
1651
+ },
1652
+ rule: {
1653
+ flex: 1,
1654
+ height: StyleSheet.hairlineWidth
1655
+ },
1500
1656
  chip: {
1501
1657
  paddingHorizontal: 12,
1502
1658
  paddingVertical: 4,
@@ -1510,7 +1666,7 @@ var styles7 = StyleSheet.create({
1510
1666
  }
1511
1667
  });
1512
1668
  function LiveCallBanner({ call, inCall, onJoin }) {
1513
- const theme = usePoolseTheme();
1669
+ const theme = useTheme();
1514
1670
  const what = call.kind === "room" ? call.media === "video" ? "Video room" : "Voice room" : call.media === "video" ? "Video call in progress" : "Voice call in progress";
1515
1671
  const who = inCall > 0 ? `${inCall} ${call.kind === "room" ? "in the room" : "on the call"}` : call.kind === "room" ? "Starting" : "Ringing";
1516
1672
  return /* @__PURE__ */ jsxs(
@@ -1530,8 +1686,8 @@ function LiveCallBanner({ call, inCall, onJoin }) {
1530
1686
  }
1531
1687
  ),
1532
1688
  /* @__PURE__ */ jsxs(View, { style: styles8.text, children: [
1533
- /* @__PURE__ */ jsx(Text, { style: [styles8.title, { fontFamily: theme.type.fontBody }], numberOfLines: 1, children: what }),
1534
- /* @__PURE__ */ jsx(Text, { style: [styles8.meta, { fontFamily: theme.type.fontBody }], numberOfLines: 1, children: who })
1689
+ /* @__PURE__ */ jsx(Text, { style: [styles8.title, { fontFamily: theme.fonts.body }], numberOfLines: 1, children: what }),
1690
+ /* @__PURE__ */ jsx(Text, { style: [styles8.meta, { fontFamily: theme.fonts.body }], numberOfLines: 1, children: who })
1535
1691
  ] }),
1536
1692
  /* @__PURE__ */ jsx(
1537
1693
  Pressable,
@@ -1544,10 +1700,7 @@ function LiveCallBanner({ call, inCall, onJoin }) {
1544
1700
  children: /* @__PURE__ */ jsx(
1545
1701
  Text,
1546
1702
  {
1547
- style: [
1548
- styles8.joinText,
1549
- { color: theme.colors.success, fontFamily: theme.type.fontBody }
1550
- ],
1703
+ style: [styles8.joinText, { color: theme.colors.success, fontFamily: theme.fonts.body }],
1551
1704
  children: "Join"
1552
1705
  }
1553
1706
  )
@@ -1578,7 +1731,7 @@ var styles8 = StyleSheet.create({
1578
1731
  joinText: { fontSize: 14, fontWeight: "700" }
1579
1732
  });
1580
1733
  function UploadQueueStrip() {
1581
- const theme = usePoolseTheme();
1734
+ const theme = useTheme();
1582
1735
  const upload = useSharedUpload();
1583
1736
  const { getPreview } = useUploadPreview();
1584
1737
  if (upload.queue.length === 0) return null;
@@ -1619,7 +1772,7 @@ function UploadQueueStrip() {
1619
1772
  children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 11, color: "#fff" })
1620
1773
  }
1621
1774
  ) : null,
1622
- isUploading ? /* @__PURE__ */ jsx(View, { style: styles9.progressOverlay, children: /* @__PURE__ */ jsx(View, { style: [styles9.spinner, { borderColor: theme.colors.onBrand }] }) }) : null,
1775
+ isUploading ? /* @__PURE__ */ jsx(View, { style: styles9.progressOverlay, children: /* @__PURE__ */ jsx(View, { style: [styles9.spinner, { borderColor: theme.colors.accentText }] }) }) : null,
1623
1776
  isError ? /* @__PURE__ */ jsx(View, { style: [styles9.errorOverlay, { backgroundColor: "rgba(229,72,77,0.85)" }], children: /* @__PURE__ */ jsx(Text, { style: [styles9.errorText, { color: "#fff" }], children: "Failed" }) }) : null
1624
1777
  ] }, item.localId);
1625
1778
  })
@@ -1627,7 +1780,7 @@ function UploadQueueStrip() {
1627
1780
  );
1628
1781
  }
1629
1782
  function ImageTile({ uri, uploading, error }) {
1630
- const theme = usePoolseTheme();
1783
+ const theme = useTheme();
1631
1784
  return /* @__PURE__ */ jsx(
1632
1785
  Image,
1633
1786
  {
@@ -1635,8 +1788,8 @@ function ImageTile({ uri, uploading, error }) {
1635
1788
  style: [
1636
1789
  styles9.imageTile,
1637
1790
  {
1638
- backgroundColor: theme.colors.surface2,
1639
- borderColor: error ? theme.colors.error : "transparent",
1791
+ backgroundColor: theme.colors.surfaceAlt,
1792
+ borderColor: error ? theme.colors.danger : "transparent",
1640
1793
  opacity: uploading ? 0.65 : 1
1641
1794
  }
1642
1795
  ],
@@ -1650,29 +1803,29 @@ function FileTile({
1650
1803
  uploading,
1651
1804
  error
1652
1805
  }) {
1653
- const theme = usePoolseTheme();
1806
+ const theme = useTheme();
1654
1807
  return /* @__PURE__ */ jsxs(
1655
1808
  View,
1656
1809
  {
1657
1810
  style: [
1658
1811
  styles9.fileTile,
1659
1812
  {
1660
- backgroundColor: theme.colors.surface2,
1661
- borderColor: error ? theme.colors.error : uploading ? theme.colors.brand : theme.colors.border
1813
+ backgroundColor: theme.colors.surfaceAlt,
1814
+ borderColor: error ? theme.colors.danger : uploading ? theme.colors.accent : theme.colors.border
1662
1815
  }
1663
1816
  ],
1664
1817
  children: [
1665
- /* @__PURE__ */ jsx(View, { style: [styles9.fileIconBox, { backgroundColor: theme.colors.brandSoft }], children: /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 18, color: theme.colors.brand }) }),
1818
+ /* @__PURE__ */ jsx(View, { style: [styles9.fileIconBox, { backgroundColor: theme.colors.accentSoft }], children: /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 18, color: theme.colors.accent }) }),
1666
1819
  /* @__PURE__ */ jsxs(View, { style: styles9.fileInfo, children: [
1667
1820
  /* @__PURE__ */ jsx(
1668
1821
  Text,
1669
1822
  {
1670
- style: [styles9.fileName, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
1823
+ style: [styles9.fileName, { color: theme.colors.text, fontFamily: theme.fonts.body }],
1671
1824
  numberOfLines: 1,
1672
1825
  children: filename
1673
1826
  }
1674
1827
  ),
1675
- /* @__PURE__ */ jsx(Text, { style: [styles9.fileSize, { color: theme.colors.ink3 }], children: formatBytes(size) })
1828
+ /* @__PURE__ */ jsx(Text, { style: [styles9.fileSize, { color: theme.colors.textSubtle }], children: formatBytes(size) })
1676
1829
  ] })
1677
1830
  ]
1678
1831
  }
@@ -1821,7 +1974,7 @@ var MessageComposer = forwardRef(
1821
1974
  onCancelEdit,
1822
1975
  onSaveEdit
1823
1976
  }, ref) {
1824
- const theme = usePoolseTheme();
1977
+ const theme = useTheme();
1825
1978
  const inputRef = useRef(null);
1826
1979
  const [value, setValue] = useState("");
1827
1980
  const [sending, setSending] = useState(false);
@@ -1921,7 +2074,7 @@ var MessageComposer = forwardRef(
1921
2074
  hitSlop: 8,
1922
2075
  style: styles10.iconBtn,
1923
2076
  accessibilityLabel: "Attach file",
1924
- children: /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 22, color: theme.colors.ink2 })
2077
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 22, color: theme.colors.textMuted })
1925
2078
  }
1926
2079
  ) : null,
1927
2080
  /* @__PURE__ */ jsx(
@@ -1934,17 +2087,17 @@ var MessageComposer = forwardRef(
1934
2087
  onTyping?.();
1935
2088
  },
1936
2089
  placeholder,
1937
- placeholderTextColor: theme.colors.ink3,
2090
+ placeholderTextColor: theme.colors.textSubtle,
1938
2091
  multiline: true,
1939
2092
  editable: !disabled,
1940
2093
  style: [
1941
2094
  styles10.input,
1942
2095
  {
1943
- color: theme.colors.ink,
1944
- backgroundColor: theme.colors.surface2,
2096
+ color: theme.colors.text,
2097
+ backgroundColor: theme.colors.surfaceAlt,
1945
2098
  borderRadius: theme.radii.lg,
1946
- fontFamily: theme.type.fontBody,
1947
- fontSize: theme.type.bodySize
2099
+ fontFamily: theme.fonts.body,
2100
+ fontSize: theme.fonts.sizeMd
1948
2101
  }
1949
2102
  ]
1950
2103
  }
@@ -1957,12 +2110,12 @@ var MessageComposer = forwardRef(
1957
2110
  style: [
1958
2111
  styles10.sendBtn,
1959
2112
  {
1960
- backgroundColor: submitDisabled ? theme.colors.ink3 : theme.colors.brand,
2113
+ backgroundColor: submitDisabled ? theme.colors.textSubtle : theme.colors.accent,
1961
2114
  opacity: submitDisabled ? 0.6 : 1
1962
2115
  }
1963
2116
  ],
1964
2117
  accessibilityLabel: "Send message",
1965
- children: /* @__PURE__ */ jsx(PoolseIcon, { name: "send", size: 18, color: theme.colors.onBrand })
2118
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: "send", size: 18, color: theme.colors.accentText })
1966
2119
  }
1967
2120
  )
1968
2121
  ] })
@@ -1972,23 +2125,23 @@ var MessageComposer = forwardRef(
1972
2125
  }
1973
2126
  );
1974
2127
  function EditChip({ message, onCancel }) {
1975
- const theme = usePoolseTheme();
2128
+ const theme = useTheme();
1976
2129
  return /* @__PURE__ */ jsxs(
1977
2130
  View,
1978
2131
  {
1979
2132
  style: [
1980
2133
  styles10.replyChip,
1981
2134
  {
1982
- backgroundColor: theme.colors.surface2,
1983
- borderLeftColor: theme.colors.brand
2135
+ backgroundColor: theme.colors.surfaceAlt,
2136
+ borderLeftColor: theme.colors.accent
1984
2137
  }
1985
2138
  ],
1986
2139
  children: [
1987
2140
  /* @__PURE__ */ jsxs(View, { style: { flex: 1 }, children: [
1988
- /* @__PURE__ */ jsx(Text, { style: [styles10.replyName, { color: theme.colors.brand }], children: "Editing message" }),
1989
- /* @__PURE__ */ jsx(Text, { style: [styles10.replyBody, { color: theme.colors.ink2 }], numberOfLines: 1, children: message.body ?? "\u2026" })
2141
+ /* @__PURE__ */ jsx(Text, { style: [styles10.replyName, { color: theme.colors.accent }], children: "Editing message" }),
2142
+ /* @__PURE__ */ jsx(Text, { style: [styles10.replyBody, { color: theme.colors.textMuted }], numberOfLines: 1, children: message.body ?? "\u2026" })
1990
2143
  ] }),
1991
- onCancel ? /* @__PURE__ */ jsx(Pressable, { onPress: onCancel, hitSlop: 8, style: styles10.replyCancel, children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.ink2 }) }) : null
2144
+ onCancel ? /* @__PURE__ */ jsx(Pressable, { onPress: onCancel, hitSlop: 8, style: styles10.replyCancel, children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
1992
2145
  ]
1993
2146
  }
1994
2147
  );
@@ -1998,7 +2151,7 @@ function ReplyChip({
1998
2151
  labelFor,
1999
2152
  onCancel
2000
2153
  }) {
2001
- const theme = usePoolseTheme();
2154
+ const theme = useTheme();
2002
2155
  const resolved = useUser(message.sender_external_id);
2003
2156
  const senderName = message.sender_external_id ? labelFor?.(message.sender_external_id) ?? resolved.profile?.displayName ?? message.sender_external_id : "Unknown";
2004
2157
  return /* @__PURE__ */ jsxs(
@@ -2007,19 +2160,19 @@ function ReplyChip({
2007
2160
  style: [
2008
2161
  styles10.replyChip,
2009
2162
  {
2010
- backgroundColor: theme.colors.surface2,
2011
- borderLeftColor: theme.colors.brand
2163
+ backgroundColor: theme.colors.surfaceAlt,
2164
+ borderLeftColor: theme.colors.accent
2012
2165
  }
2013
2166
  ],
2014
2167
  children: [
2015
2168
  /* @__PURE__ */ jsxs(View, { style: { flex: 1 }, children: [
2016
- /* @__PURE__ */ jsxs(Text, { style: [styles10.replyName, { color: theme.colors.brand }], children: [
2169
+ /* @__PURE__ */ jsxs(Text, { style: [styles10.replyName, { color: theme.colors.accent }], children: [
2017
2170
  "Replying to ",
2018
2171
  senderName
2019
2172
  ] }),
2020
- /* @__PURE__ */ jsx(Text, { style: [styles10.replyBody, { color: theme.colors.ink2 }], numberOfLines: 1, children: message.body ?? "\u2026" })
2173
+ /* @__PURE__ */ jsx(Text, { style: [styles10.replyBody, { color: theme.colors.textMuted }], numberOfLines: 1, children: message.body ?? "\u2026" })
2021
2174
  ] }),
2022
- onCancel ? /* @__PURE__ */ jsx(Pressable, { onPress: onCancel, hitSlop: 8, style: styles10.replyCancel, children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.ink2 }) }) : null
2175
+ onCancel ? /* @__PURE__ */ jsx(Pressable, { onPress: onCancel, hitSlop: 8, style: styles10.replyCancel, children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
2023
2176
  ]
2024
2177
  }
2025
2178
  );
@@ -2082,7 +2235,7 @@ var styles10 = StyleSheet.create({
2082
2235
  }
2083
2236
  });
2084
2237
  function MentionInput({ conversationId, onSend, ...composerProps }) {
2085
- const theme = usePoolseTheme();
2238
+ const theme = useTheme();
2086
2239
  const insets = useSafeInsets();
2087
2240
  const keyboardOpen = useKeyboardOpen();
2088
2241
  const { members } = useMembers(conversationId);
@@ -2144,7 +2297,7 @@ function MentionInput({ conversationId, onSend, ...composerProps }) {
2144
2297
  /* @__PURE__ */ jsx(
2145
2298
  Text,
2146
2299
  {
2147
- style: [styles11.title, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
2300
+ style: [styles11.title, { color: theme.colors.text, fontFamily: theme.fonts.body }],
2148
2301
  children: "Mention a member"
2149
2302
  }
2150
2303
  ),
@@ -2175,10 +2328,10 @@ function MentionInput({ conversationId, onSend, ...composerProps }) {
2175
2328
  ] });
2176
2329
  }
2177
2330
  function MentionRow({ member, onPress }) {
2178
- const theme = usePoolseTheme();
2331
+ const theme = useTheme();
2179
2332
  return /* @__PURE__ */ jsxs(Pressable, { onPress, style: styles11.row, children: [
2180
2333
  /* @__PURE__ */ jsx(Avatar, { src: null, name: member.external_id, seed: member.external_id, size: "sm" }),
2181
- /* @__PURE__ */ jsx(Text, { style: [styles11.rowText, { color: theme.colors.ink, fontFamily: theme.type.fontBody }], children: member.external_id })
2334
+ /* @__PURE__ */ jsx(Text, { style: [styles11.rowText, { color: theme.colors.text, fontFamily: theme.fonts.body }], children: member.external_id })
2182
2335
  ] });
2183
2336
  }
2184
2337
  var styles11 = StyleSheet.create({
@@ -2238,7 +2391,7 @@ function MessageList({
2238
2391
  scrollToMessageId = null,
2239
2392
  scrollRequest = 0
2240
2393
  }) {
2241
- const theme = usePoolseTheme();
2394
+ const theme = useTheme();
2242
2395
  const flatListRef = useRef(null);
2243
2396
  const [atBottom, setAtBottom] = useState(true);
2244
2397
  const [newCount, setNewCount] = useState(0);
@@ -2306,10 +2459,10 @@ function MessageList({
2306
2459
  [renderItem, data.length]
2307
2460
  );
2308
2461
  if (loading && messages.length === 0) {
2309
- return /* @__PURE__ */ jsx(View, { style: [styles12.placeholder, { backgroundColor: theme.colors.paper }], children: /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.brand }) });
2462
+ return /* @__PURE__ */ jsx(View, { style: [styles12.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.accent }) });
2310
2463
  }
2311
2464
  if (messages.length === 0) {
2312
- return /* @__PURE__ */ jsx(View, { style: [styles12.placeholder, { backgroundColor: theme.colors.paper }], children: typeof emptyState === "string" ? /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.ink3, fontFamily: theme.type.fontBody }, children: emptyState }) : emptyState ?? null });
2465
+ return /* @__PURE__ */ jsx(View, { style: [styles12.placeholder, { backgroundColor: theme.colors.background }], children: typeof emptyState === "string" ? /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState }) : emptyState ?? null });
2313
2466
  }
2314
2467
  return /* @__PURE__ */ jsxs(View, { style: styles12.root, children: [
2315
2468
  /* @__PURE__ */ jsx(
@@ -2327,10 +2480,10 @@ function MessageList({
2327
2480
  scrollEventThrottle: 32,
2328
2481
  ListHeaderComponent: ListHeader,
2329
2482
  ListFooterComponent: /* @__PURE__ */ jsxs(View, { children: [
2330
- hasMore && loading ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.ink3, style: { marginVertical: 8 } }) : null,
2483
+ hasMore && loading ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.colors.textSubtle, style: { marginVertical: 8 } }) : null,
2331
2484
  ListFooter
2332
2485
  ] }),
2333
- style: { backgroundColor: theme.colors.paper },
2486
+ style: { backgroundColor: theme.colors.background },
2334
2487
  contentContainerStyle: { paddingVertical: 8 }
2335
2488
  }
2336
2489
  ),
@@ -2341,14 +2494,14 @@ function MessageList({
2341
2494
  style: [
2342
2495
  styles12.jumpButton,
2343
2496
  {
2344
- backgroundColor: theme.colors.brand
2497
+ backgroundColor: theme.colors.accent
2345
2498
  },
2346
2499
  theme.shadows.sm
2347
2500
  ],
2348
2501
  accessibilityLabel: `${newCount} new ${newCount === 1 ? "message" : "messages"}, jump to latest`,
2349
2502
  children: [
2350
- /* @__PURE__ */ jsx(PoolseIcon, { name: "chevron-down", size: 14, color: theme.colors.onBrand }),
2351
- /* @__PURE__ */ jsxs(Text, { style: [styles12.jumpText, { color: theme.colors.onBrand }], children: [
2503
+ /* @__PURE__ */ jsx(PoolseIcon, { name: "chevron-down", size: 14, color: theme.colors.accentText }),
2504
+ /* @__PURE__ */ jsxs(Text, { style: [styles12.jumpText, { color: theme.colors.accentText }], children: [
2352
2505
  newCount,
2353
2506
  " new ",
2354
2507
  newCount === 1 ? "message" : "messages"
@@ -2385,13 +2538,13 @@ var styles12 = StyleSheet.create({
2385
2538
  }
2386
2539
  });
2387
2540
  function CallLogRow({ msg, meId, onCallBack }) {
2388
- const theme = usePoolseTheme();
2541
+ const theme = useTheme();
2389
2542
  const display = callLogDisplayFor(msg, meId);
2390
2543
  if (!display) return null;
2391
- const accent = display.missed ? theme.colors.error : theme.colors.ink3;
2544
+ const accent = display.missed ? theme.colors.danger : theme.colors.textSubtle;
2392
2545
  const time = formatTime(msg.inserted_at);
2393
2546
  const label = [display.title, display.detail, time].filter(Boolean).join(", ");
2394
- const metaStyle = [styles13.meta, { color: theme.colors.ink3, fontFamily: theme.type.fontBody }];
2547
+ const metaStyle = [styles13.meta, { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }];
2395
2548
  return /* @__PURE__ */ jsxs(View, { style: styles13.wrap, accessible: true, accessibilityLabel: label, children: [
2396
2549
  /* @__PURE__ */ jsxs(
2397
2550
  View,
@@ -2399,7 +2552,7 @@ function CallLogRow({ msg, meId, onCallBack }) {
2399
2552
  style: [
2400
2553
  styles13.chip,
2401
2554
  {
2402
- backgroundColor: theme.colors.surface2,
2555
+ backgroundColor: theme.colors.surfaceAlt,
2403
2556
  borderColor: theme.colors.border
2404
2557
  }
2405
2558
  ],
@@ -2411,8 +2564,8 @@ function CallLogRow({ msg, meId, onCallBack }) {
2411
2564
  style: [
2412
2565
  styles13.title,
2413
2566
  {
2414
- color: display.missed ? theme.colors.error : theme.colors.ink2,
2415
- fontFamily: theme.type.fontBody
2567
+ color: display.missed ? theme.colors.danger : theme.colors.textMuted,
2568
+ fontFamily: theme.fonts.body
2416
2569
  }
2417
2570
  ],
2418
2571
  numberOfLines: 1,
@@ -2443,7 +2596,7 @@ function CallLogRow({ msg, meId, onCallBack }) {
2443
2596
  {
2444
2597
  style: [
2445
2598
  styles13.callBackText,
2446
- { color: theme.colors.brand, fontFamily: theme.type.fontBody }
2599
+ { color: theme.colors.accent, fontFamily: theme.fonts.body }
2447
2600
  ],
2448
2601
  children: "Call back"
2449
2602
  }
@@ -2491,149 +2644,13 @@ var styles13 = StyleSheet.create({
2491
2644
  fontVariant: ["tabular-nums"]
2492
2645
  }
2493
2646
  });
2494
- var DEFAULT_REACTION_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F64F}", "\u{1F525}"];
2495
- function MessageActions({
2496
- visible,
2497
- onClose,
2498
- isSelf,
2499
- emojis = DEFAULT_REACTION_EMOJIS,
2500
- onPickReaction,
2501
- onReply,
2502
- onReplyInThread,
2503
- onQuote,
2504
- onEdit,
2505
- onDelete,
2506
- onCopy
2507
- }) {
2508
- const theme = usePoolseTheme();
2509
- const insets = useSafeInsets();
2510
- const items = [];
2511
- if (onReply) items.push({ label: "Reply", icon: "reply", onPress: onReply });
2512
- if (onQuote) items.push({ label: "Quote reply", icon: "reply", onPress: onQuote });
2513
- if (onReplyInThread)
2514
- items.push({ label: "Reply in thread", icon: "messages", onPress: onReplyInThread });
2515
- if (onCopy) items.push({ label: "Copy text", icon: "copy", onPress: onCopy });
2516
- if (isSelf && onEdit) items.push({ label: "Edit", icon: "edit", onPress: onEdit });
2517
- if (isSelf && onDelete)
2518
- items.push({ label: "Delete", icon: "trash", onPress: onDelete, danger: true });
2519
- const showEmojiRow = !!onPickReaction && emojis.length > 0;
2520
- return /* @__PURE__ */ jsx(
2521
- Modal,
2522
- {
2523
- visible,
2524
- transparent: true,
2525
- animationType: "fade",
2526
- onRequestClose: onClose,
2527
- ...EDGE_TO_EDGE_MODAL,
2528
- children: /* @__PURE__ */ jsx(Pressable, { style: styles14.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs(
2529
- View,
2530
- {
2531
- style: [
2532
- styles14.sheet,
2533
- {
2534
- backgroundColor: theme.colors.surface,
2535
- borderTopLeftRadius: theme.radii.lg,
2536
- borderTopRightRadius: theme.radii.lg,
2537
- // Last action row must sit above the nav bar / home indicator.
2538
- paddingBottom: 24 + insets.bottom,
2539
- paddingLeft: insets.left,
2540
- paddingRight: insets.right
2541
- },
2542
- theme.shadows.lg
2543
- ],
2544
- children: [
2545
- showEmojiRow ? /* @__PURE__ */ jsx(View, { style: [styles14.emojiRow, { borderBottomColor: theme.colors.border }], children: emojis.map((emoji) => /* @__PURE__ */ jsx(
2546
- Pressable,
2547
- {
2548
- onPress: () => {
2549
- onPickReaction(emoji);
2550
- onClose();
2551
- },
2552
- style: styles14.emojiBtn,
2553
- hitSlop: 6,
2554
- accessibilityLabel: `React with ${emoji}`,
2555
- children: /* @__PURE__ */ jsx(Text, { style: styles14.emoji, children: emoji })
2556
- },
2557
- emoji
2558
- )) }) : null,
2559
- items.map((item) => /* @__PURE__ */ jsxs(Pressable, { onPress: item.onPress, style: styles14.item, children: [
2560
- /* @__PURE__ */ jsx(
2561
- PoolseIcon,
2562
- {
2563
- name: item.icon,
2564
- size: 18,
2565
- color: item.danger ? theme.colors.error : theme.colors.ink2
2566
- }
2567
- ),
2568
- /* @__PURE__ */ jsx(
2569
- Text,
2570
- {
2571
- style: [
2572
- styles14.itemText,
2573
- {
2574
- color: item.danger ? theme.colors.error : theme.colors.ink,
2575
- fontFamily: theme.type.fontBody
2576
- }
2577
- ],
2578
- children: item.label
2579
- }
2580
- )
2581
- ] }, item.label))
2582
- ]
2583
- }
2584
- ) })
2585
- }
2586
- );
2587
- }
2588
- var styles14 = StyleSheet.create({
2589
- backdrop: {
2590
- flex: 1,
2591
- backgroundColor: "rgba(0,0,0,0.35)",
2592
- justifyContent: "flex-end"
2593
- },
2594
- sheet: {
2595
- paddingTop: 8,
2596
- paddingBottom: 24
2597
- },
2598
- emojiRow: {
2599
- flexDirection: "row",
2600
- alignItems: "center",
2601
- justifyContent: "space-around",
2602
- paddingHorizontal: 12,
2603
- paddingVertical: 10,
2604
- borderBottomWidth: StyleSheet.hairlineWidth,
2605
- marginBottom: 6
2606
- },
2607
- emojiBtn: {
2608
- paddingHorizontal: 6,
2609
- paddingVertical: 6,
2610
- borderRadius: 999,
2611
- alignItems: "center",
2612
- justifyContent: "center"
2613
- },
2614
- emoji: {
2615
- fontSize: 30,
2616
- lineHeight: 36
2617
- },
2618
- item: {
2619
- flexDirection: "row",
2620
- alignItems: "center",
2621
- paddingHorizontal: 20,
2622
- paddingVertical: 14,
2623
- gap: 14
2624
- },
2625
- itemText: {
2626
- fontSize: 15,
2627
- fontWeight: "500"
2628
- }
2629
- });
2630
2647
  function AttachmentPreview({
2631
2648
  attachment,
2632
2649
  onPress,
2633
2650
  maxWidth = 280,
2634
2651
  tone = "default"
2635
2652
  }) {
2636
- const theme = usePoolseTheme();
2653
+ const theme = useTheme();
2637
2654
  const isImage = (attachment.content_type ?? "").startsWith("image/");
2638
2655
  const { url } = useAttachmentUrl(attachment.id);
2639
2656
  if (isImage) {
@@ -2645,7 +2662,7 @@ function AttachmentPreview({
2645
2662
  width: maxWidth,
2646
2663
  height: 200,
2647
2664
  borderRadius: theme.radii.md,
2648
- backgroundColor: theme.colors.surface2
2665
+ backgroundColor: theme.colors.surfaceAlt
2649
2666
  },
2650
2667
  resizeMode: "cover",
2651
2668
  accessible: true,
@@ -2655,45 +2672,45 @@ function AttachmentPreview({
2655
2672
  View,
2656
2673
  {
2657
2674
  style: [
2658
- styles15.imagePlaceholder,
2675
+ styles14.imagePlaceholder,
2659
2676
  {
2660
2677
  width: maxWidth,
2661
2678
  height: 200,
2662
2679
  borderRadius: theme.radii.md,
2663
- backgroundColor: theme.colors.surface2
2680
+ backgroundColor: theme.colors.surfaceAlt
2664
2681
  }
2665
2682
  ]
2666
2683
  }
2667
2684
  ) });
2668
2685
  }
2669
2686
  const onBrand = tone === "onBrand";
2670
- const ink = onBrand ? theme.colors.onBrand : theme.colors.ink;
2671
- const inkSoft = onBrand ? theme.colors.onBrand : theme.colors.ink3;
2687
+ const ink = onBrand ? theme.colors.ownBubbleText : theme.colors.text;
2688
+ const inkSoft = onBrand ? theme.colors.ownBubbleText : theme.colors.textSubtle;
2672
2689
  return /* @__PURE__ */ jsxs(
2673
2690
  Pressable,
2674
2691
  {
2675
2692
  onPress,
2676
2693
  disabled: !onPress,
2677
2694
  style: [
2678
- styles15.fileCard,
2695
+ styles14.fileCard,
2679
2696
  {
2680
- backgroundColor: onBrand ? "rgba(255,255,255,0.18)" : theme.colors.surface2,
2697
+ backgroundColor: onBrand ? "rgba(255,255,255,0.18)" : theme.colors.surfaceAlt,
2681
2698
  borderColor: onBrand ? "transparent" : theme.colors.border,
2682
2699
  borderRadius: theme.radii.md
2683
2700
  }
2684
2701
  ],
2685
2702
  children: [
2686
- /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 18, color: onBrand ? ink : theme.colors.ink2 }),
2703
+ /* @__PURE__ */ jsx(PoolseIcon, { name: "attachment", size: 18, color: onBrand ? ink : theme.colors.textMuted }),
2687
2704
  /* @__PURE__ */ jsxs(View, { style: { flex: 1, marginLeft: 8 }, children: [
2688
2705
  /* @__PURE__ */ jsx(
2689
2706
  Text,
2690
2707
  {
2691
- style: [styles15.fileName, { color: ink, fontFamily: theme.type.fontBody }],
2708
+ style: [styles14.fileName, { color: ink, fontFamily: theme.fonts.body }],
2692
2709
  numberOfLines: 1,
2693
2710
  children: attachment.original_filename ?? "file"
2694
2711
  }
2695
2712
  ),
2696
- /* @__PURE__ */ jsx(Text, { style: [styles15.fileSize, { color: inkSoft, opacity: onBrand ? 0.8 : 1 }], children: formatBytes2(attachment.byte_size) })
2713
+ /* @__PURE__ */ jsx(Text, { style: [styles14.fileSize, { color: inkSoft, opacity: onBrand ? 0.8 : 1 }], children: formatBytes2(attachment.byte_size) })
2697
2714
  ] })
2698
2715
  ]
2699
2716
  }
@@ -2705,7 +2722,7 @@ function formatBytes2(n) {
2705
2722
  if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
2706
2723
  return `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
2707
2724
  }
2708
- var styles15 = StyleSheet.create({
2725
+ var styles14 = StyleSheet.create({
2709
2726
  imagePlaceholder: {},
2710
2727
  fileCard: {
2711
2728
  flexDirection: "row",
@@ -2728,7 +2745,7 @@ function ImageMosaic({
2728
2745
  squareBottom = false,
2729
2746
  onLongPress
2730
2747
  }) {
2731
- const theme = usePoolseTheme();
2748
+ const theme = useTheme();
2732
2749
  const r = radius ?? theme.radii.md;
2733
2750
  const rBottom = squareBottom ? 5 : r;
2734
2751
  const [viewerIndex, setViewerIndex] = useState(null);
@@ -2741,7 +2758,7 @@ function ImageMosaic({
2741
2758
  View,
2742
2759
  {
2743
2760
  style: [
2744
- styles16.root,
2761
+ styles15.root,
2745
2762
  {
2746
2763
  borderTopLeftRadius: r,
2747
2764
  borderTopRightRadius: r,
@@ -2762,18 +2779,18 @@ function ImageMosaic({
2762
2779
  {
2763
2780
  onLongPress,
2764
2781
  attachment: visible[0],
2765
- style: styles16.tileFull,
2782
+ style: styles15.tileFull,
2766
2783
  onPress: () => setViewerIndex(0),
2767
2784
  overlay: null
2768
2785
  }
2769
2786
  ) : null,
2770
- n === 2 ? /* @__PURE__ */ jsxs(View, { style: styles16.rowEven, children: [
2787
+ n === 2 ? /* @__PURE__ */ jsxs(View, { style: styles15.rowEven, children: [
2771
2788
  /* @__PURE__ */ jsx(
2772
2789
  Tile,
2773
2790
  {
2774
2791
  onLongPress,
2775
2792
  attachment: visible[0],
2776
- style: styles16.tileHalfSquare,
2793
+ style: styles15.tileHalfSquare,
2777
2794
  onPress: () => setViewerIndex(0),
2778
2795
  overlay: null
2779
2796
  }
@@ -2783,7 +2800,7 @@ function ImageMosaic({
2783
2800
  {
2784
2801
  onLongPress,
2785
2802
  attachment: visible[1],
2786
- style: styles16.tileHalfSquare,
2803
+ style: styles15.tileHalfSquare,
2787
2804
  onPress: () => setViewerIndex(1),
2788
2805
  overlay: null
2789
2806
  }
@@ -2795,18 +2812,18 @@ function ImageMosaic({
2795
2812
  {
2796
2813
  onLongPress,
2797
2814
  attachment: visible[0],
2798
- style: styles16.tileHero,
2815
+ style: styles15.tileHero,
2799
2816
  onPress: () => setViewerIndex(0),
2800
2817
  overlay: null
2801
2818
  }
2802
2819
  ),
2803
- /* @__PURE__ */ jsxs(View, { style: [styles16.rowEven, { marginTop: 2 }], children: [
2820
+ /* @__PURE__ */ jsxs(View, { style: [styles15.rowEven, { marginTop: 2 }], children: [
2804
2821
  /* @__PURE__ */ jsx(
2805
2822
  Tile,
2806
2823
  {
2807
2824
  onLongPress,
2808
2825
  attachment: visible[1],
2809
- style: styles16.tileHalfSquare,
2826
+ style: styles15.tileHalfSquare,
2810
2827
  onPress: () => setViewerIndex(1),
2811
2828
  overlay: null
2812
2829
  }
@@ -2816,7 +2833,7 @@ function ImageMosaic({
2816
2833
  {
2817
2834
  onLongPress,
2818
2835
  attachment: visible[2],
2819
- style: styles16.tileHalfSquare,
2836
+ style: styles15.tileHalfSquare,
2820
2837
  onPress: () => setViewerIndex(2),
2821
2838
  overlay: null
2822
2839
  }
@@ -2824,13 +2841,13 @@ function ImageMosaic({
2824
2841
  ] })
2825
2842
  ] }) : null,
2826
2843
  n === 4 ? /* @__PURE__ */ jsxs(Fragment, { children: [
2827
- /* @__PURE__ */ jsxs(View, { style: styles16.rowEven, children: [
2844
+ /* @__PURE__ */ jsxs(View, { style: styles15.rowEven, children: [
2828
2845
  /* @__PURE__ */ jsx(
2829
2846
  Tile,
2830
2847
  {
2831
2848
  onLongPress,
2832
2849
  attachment: visible[0],
2833
- style: styles16.tileHalfSquare,
2850
+ style: styles15.tileHalfSquare,
2834
2851
  onPress: () => setViewerIndex(0),
2835
2852
  overlay: null
2836
2853
  }
@@ -2840,19 +2857,19 @@ function ImageMosaic({
2840
2857
  {
2841
2858
  onLongPress,
2842
2859
  attachment: visible[1],
2843
- style: styles16.tileHalfSquare,
2860
+ style: styles15.tileHalfSquare,
2844
2861
  onPress: () => setViewerIndex(1),
2845
2862
  overlay: null
2846
2863
  }
2847
2864
  )
2848
2865
  ] }),
2849
- /* @__PURE__ */ jsxs(View, { style: [styles16.rowEven, { marginTop: 2 }], children: [
2866
+ /* @__PURE__ */ jsxs(View, { style: [styles15.rowEven, { marginTop: 2 }], children: [
2850
2867
  /* @__PURE__ */ jsx(
2851
2868
  Tile,
2852
2869
  {
2853
2870
  onLongPress,
2854
2871
  attachment: visible[2],
2855
- style: styles16.tileHalfSquare,
2872
+ style: styles15.tileHalfSquare,
2856
2873
  onPress: () => setViewerIndex(2),
2857
2874
  overlay: null
2858
2875
  }
@@ -2862,7 +2879,7 @@ function ImageMosaic({
2862
2879
  {
2863
2880
  onLongPress,
2864
2881
  attachment: visible[3],
2865
- style: styles16.tileHalfSquare,
2882
+ style: styles15.tileHalfSquare,
2866
2883
  onPress: () => setViewerIndex(3),
2867
2884
  overlay: overflow > 0 ? `+${overflow}` : null
2868
2885
  }
@@ -2898,20 +2915,20 @@ function Tile({
2898
2915
  onPress,
2899
2916
  onLongPress
2900
2917
  }) {
2901
- const theme = usePoolseTheme();
2918
+ const theme = useTheme();
2902
2919
  const { url } = useAttachmentUrl(attachment.id);
2903
- return /* @__PURE__ */ jsxs(Pressable, { onPress, onLongPress, style: [styles16.tileBase, style], children: [
2920
+ return /* @__PURE__ */ jsxs(Pressable, { onPress, onLongPress, style: [styles15.tileBase, style], children: [
2904
2921
  url ? /* @__PURE__ */ jsx(
2905
2922
  Image,
2906
2923
  {
2907
2924
  source: { uri: url },
2908
- style: [styles16.tileImage, { backgroundColor: theme.colors.surface2 }],
2925
+ style: [styles15.tileImage, { backgroundColor: theme.colors.surfaceAlt }],
2909
2926
  resizeMode: "cover",
2910
2927
  accessible: true,
2911
2928
  accessibilityLabel: attachment.original_filename ?? "image"
2912
2929
  }
2913
- ) : /* @__PURE__ */ jsx(View, { style: [styles16.tileImage, { backgroundColor: theme.colors.surface2 }] }),
2914
- overlay ? /* @__PURE__ */ jsx(View, { style: styles16.overflow, children: /* @__PURE__ */ jsx(Text, { style: styles16.overflowText, children: overlay }) }) : null
2930
+ ) : /* @__PURE__ */ jsx(View, { style: [styles15.tileImage, { backgroundColor: theme.colors.surfaceAlt }] }),
2931
+ overlay ? /* @__PURE__ */ jsx(View, { style: styles15.overflow, children: /* @__PURE__ */ jsx(Text, { style: styles15.overflowText, children: overlay }) }) : null
2915
2932
  ] });
2916
2933
  }
2917
2934
  function FullScreenViewer({
@@ -2921,7 +2938,7 @@ function FullScreenViewer({
2921
2938
  const { url } = useAttachmentUrl(attachment.id);
2922
2939
  const { width, height } = useWindowDimensions();
2923
2940
  const insets = useSafeInsets();
2924
- return /* @__PURE__ */ jsxs(Pressable, { style: styles16.viewer, onPress: onClose, children: [
2941
+ return /* @__PURE__ */ jsxs(Pressable, { style: styles15.viewer, onPress: onClose, children: [
2925
2942
  url ? /* @__PURE__ */ jsx(
2926
2943
  Image,
2927
2944
  {
@@ -2937,14 +2954,14 @@ function FullScreenViewer({
2937
2954
  {
2938
2955
  onPress: onClose,
2939
2956
  hitSlop: 12,
2940
- style: [styles16.closeBtn, { top: insets.top + 12, right: insets.right + 16 }],
2957
+ style: [styles15.closeBtn, { top: insets.top + 12, right: insets.right + 16 }],
2941
2958
  accessibilityLabel: "Close viewer",
2942
2959
  children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 20, color: "#ffffff" })
2943
2960
  }
2944
2961
  )
2945
2962
  ] });
2946
2963
  }
2947
- var styles16 = StyleSheet.create({
2964
+ var styles15 = StyleSheet.create({
2948
2965
  root: {
2949
2966
  width: "100%",
2950
2967
  overflow: "hidden",
@@ -3070,72 +3087,238 @@ function renderMarkdown(body, args) {
3070
3087
  };
3071
3088
  return createElement(Markdown, { style, markdownit, onLinkPress: args.onLinkPress }, body);
3072
3089
  }
3073
- function MessageBubble({
3074
- message,
3075
- currentUserId,
3076
- readState,
3077
- labelFor,
3078
- onQuotedClick,
3079
- groupPosition = "standalone",
3080
- maxBodyLength = 0,
3081
- showSenderName = false,
3082
- onSenderPress,
3083
- actionsTrigger,
3084
- showAttachments = true,
3085
- markdown = true,
3086
- onLongPress
3087
- }) {
3088
- const theme = usePoolseTheme();
3089
- const { width: screenWidth } = useWindowDimensions();
3090
- const isSelf = currentUserId !== null && message.sender_id === currentUserId;
3091
- const [expanded, setExpanded] = useState(false);
3092
- const [lastLineWidth, setLastLineWidth] = useState(null);
3093
- const [textBoxWidth, setTextBoxWidth] = useState(null);
3094
- const [metaWidth, setMetaWidth] = useState(null);
3095
- const bubbleMaxWidth = Math.floor(screenWidth * 0.78);
3096
- const mediaWidth = Math.min(bubbleMaxWidth - 6, 420);
3097
- const sender = useUser(!isSelf ? message.sender_external_id : null);
3098
- const senderFallbackName = message.sender_external_id ?? "Unknown";
3099
- const senderLabel = sender.profile?.displayName ?? (message.sender_external_id ? labelFor?.(message.sender_external_id) ?? senderFallbackName : senderFallbackName);
3100
- const senderTint = userColor(message.sender_external_id ?? message.sender_id ?? message.id);
3101
- const tailCorner = groupPosition === "last" || groupPosition === "standalone";
3102
- const bubbleRadius = theme.radii.bubble;
3103
- const textColor = isSelf ? theme.colors.selfBubbleText : theme.colors.otherBubbleText;
3104
- const mutedOnBubble = isSelf ? theme.colors.onBrand : theme.colors.ink3;
3105
- const radii2 = {
3106
- topLeft: bubbleRadius,
3107
- topRight: bubbleRadius,
3108
- bottomLeft: bubbleRadius,
3109
- bottomRight: bubbleRadius
3110
- };
3111
- if (tailCorner) {
3112
- if (isSelf) radii2.bottomRight = 5;
3113
- else radii2.bottomLeft = 5;
3090
+
3091
+ // src/layout.ts
3092
+ function formatClock(date, format2) {
3093
+ if (typeof format2 === "function") return format2(date);
3094
+ if (format2 === "12h") {
3095
+ return date.toLocaleTimeString([], { hour: "numeric", minute: "2-digit", hour12: true });
3114
3096
  }
3115
- const body = message.body ?? "";
3116
- const isDeleted = !!message.deleted_at;
3117
- const isEdited = !!message.edited_at && !isDeleted;
3118
- const trimmable = maxBodyLength > 0 && body.length > maxBodyLength;
3119
- const truncated = trimmable && !expanded ? body.slice(0, maxBodyLength) + "\u2026" : body;
3120
- const time = formatTime2(message.inserted_at);
3121
- const images = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
3122
- const files = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
3123
- const hasMedia = images.length > 0;
3124
- const hasFiles = files.length > 0;
3125
- const hasBody = !isDeleted && body.length > 0;
3126
- const metaOverlay = hasMedia && !hasBody && !hasFiles;
3127
- const jumboCount = hasBody && !hasMedia && !hasFiles && !message.quoted_message_id ? emojiOnlyCount(body) : 0;
3097
+ if (format2 === "24h") {
3098
+ return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
3099
+ }
3100
+ return date.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
3101
+ }
3102
+ function formatMessageTime(iso, format2) {
3103
+ if (!iso) return "";
3104
+ const date = new Date(iso);
3105
+ if (Number.isNaN(date.getTime())) return "";
3106
+ return formatClock(date, format2);
3107
+ }
3108
+ function mentionsViewer(msg, meId) {
3109
+ return meId !== null && msg.sender_id !== meId && (msg.mentions ?? []).includes(meId);
3110
+ }
3111
+ function renderSlot(slot, ctx, children) {
3112
+ return slot && ctx ? slot({ ...ctx, children }) : children;
3113
+ }
3114
+ var DEFAULT_REACTION_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F64F}", "\u{1F525}"];
3115
+ function MessageActions({
3116
+ visible,
3117
+ onClose,
3118
+ isSelf,
3119
+ emojis = DEFAULT_REACTION_EMOJIS,
3120
+ onPickReaction,
3121
+ onReply,
3122
+ onReplyInThread,
3123
+ onQuote,
3124
+ onEdit,
3125
+ onDelete,
3126
+ onCopy
3127
+ }) {
3128
+ const theme = useTheme();
3129
+ const insets = useSafeInsets();
3130
+ const items = [];
3131
+ if (onReply) items.push({ label: "Reply", icon: "reply", onPress: onReply });
3132
+ if (onQuote) items.push({ label: "Quote reply", icon: "reply", onPress: onQuote });
3133
+ if (onReplyInThread)
3134
+ items.push({ label: "Reply in thread", icon: "messages", onPress: onReplyInThread });
3135
+ if (onCopy) items.push({ label: "Copy text", icon: "copy", onPress: onCopy });
3136
+ if (isSelf && onEdit) items.push({ label: "Edit", icon: "edit", onPress: onEdit });
3137
+ if (isSelf && onDelete)
3138
+ items.push({ label: "Delete", icon: "trash", onPress: onDelete, danger: true });
3139
+ const showEmojiRow = !!onPickReaction && emojis.length > 0;
3140
+ return /* @__PURE__ */ jsx(
3141
+ Modal,
3142
+ {
3143
+ visible,
3144
+ transparent: true,
3145
+ animationType: "fade",
3146
+ onRequestClose: onClose,
3147
+ ...EDGE_TO_EDGE_MODAL,
3148
+ children: /* @__PURE__ */ jsx(Pressable, { style: styles16.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs(
3149
+ View,
3150
+ {
3151
+ style: [
3152
+ styles16.sheet,
3153
+ {
3154
+ backgroundColor: theme.colors.surface,
3155
+ borderTopLeftRadius: theme.radii.lg,
3156
+ borderTopRightRadius: theme.radii.lg,
3157
+ // Last action row must sit above the nav bar / home indicator.
3158
+ paddingBottom: 24 + insets.bottom,
3159
+ paddingLeft: insets.left,
3160
+ paddingRight: insets.right
3161
+ },
3162
+ theme.shadows.lg
3163
+ ],
3164
+ children: [
3165
+ showEmojiRow ? /* @__PURE__ */ jsx(View, { style: [styles16.emojiRow, { borderBottomColor: theme.colors.border }], children: emojis.map((emoji) => /* @__PURE__ */ jsx(
3166
+ Pressable,
3167
+ {
3168
+ onPress: () => {
3169
+ onPickReaction(emoji);
3170
+ onClose();
3171
+ },
3172
+ style: styles16.emojiBtn,
3173
+ hitSlop: 6,
3174
+ accessibilityLabel: `React with ${emoji}`,
3175
+ children: /* @__PURE__ */ jsx(Text, { style: styles16.emoji, children: emoji })
3176
+ },
3177
+ emoji
3178
+ )) }) : null,
3179
+ items.map((item) => /* @__PURE__ */ jsxs(Pressable, { onPress: item.onPress, style: styles16.item, children: [
3180
+ /* @__PURE__ */ jsx(
3181
+ PoolseIcon,
3182
+ {
3183
+ name: item.icon,
3184
+ size: 18,
3185
+ color: item.danger ? theme.colors.danger : theme.colors.textMuted
3186
+ }
3187
+ ),
3188
+ /* @__PURE__ */ jsx(
3189
+ Text,
3190
+ {
3191
+ style: [
3192
+ styles16.itemText,
3193
+ {
3194
+ color: item.danger ? theme.colors.danger : theme.colors.text,
3195
+ fontFamily: theme.fonts.body
3196
+ }
3197
+ ],
3198
+ children: item.label
3199
+ }
3200
+ )
3201
+ ] }, item.label))
3202
+ ]
3203
+ }
3204
+ ) })
3205
+ }
3206
+ );
3207
+ }
3208
+ var styles16 = StyleSheet.create({
3209
+ backdrop: {
3210
+ flex: 1,
3211
+ backgroundColor: "rgba(0,0,0,0.35)",
3212
+ justifyContent: "flex-end"
3213
+ },
3214
+ sheet: {
3215
+ paddingTop: 8,
3216
+ paddingBottom: 24
3217
+ },
3218
+ emojiRow: {
3219
+ flexDirection: "row",
3220
+ alignItems: "center",
3221
+ justifyContent: "space-around",
3222
+ paddingHorizontal: 12,
3223
+ paddingVertical: 10,
3224
+ borderBottomWidth: StyleSheet.hairlineWidth,
3225
+ marginBottom: 6
3226
+ },
3227
+ emojiBtn: {
3228
+ paddingHorizontal: 6,
3229
+ paddingVertical: 6,
3230
+ borderRadius: 999,
3231
+ alignItems: "center",
3232
+ justifyContent: "center"
3233
+ },
3234
+ emoji: {
3235
+ fontSize: 30,
3236
+ lineHeight: 36
3237
+ },
3238
+ item: {
3239
+ flexDirection: "row",
3240
+ alignItems: "center",
3241
+ paddingHorizontal: 20,
3242
+ paddingVertical: 14,
3243
+ gap: 14
3244
+ },
3245
+ itemText: {
3246
+ fontSize: 15,
3247
+ fontWeight: "500"
3248
+ }
3249
+ });
3250
+ function MessageBubble({
3251
+ message,
3252
+ currentUserId,
3253
+ readState,
3254
+ labelFor,
3255
+ onQuotedClick,
3256
+ groupPosition = "standalone",
3257
+ maxBodyLength = 0,
3258
+ showSenderName = false,
3259
+ onSenderPress,
3260
+ actionsTrigger,
3261
+ showAttachments = true,
3262
+ markdown = true,
3263
+ onLongPress,
3264
+ timeFormat,
3265
+ density = "comfortable",
3266
+ slots,
3267
+ slotContext
3268
+ }) {
3269
+ const dense = density === "compact";
3270
+ const theme = useTheme();
3271
+ const { width: screenWidth } = useWindowDimensions();
3272
+ const isSelf = currentUserId !== null && message.sender_id === currentUserId;
3273
+ const [expanded, setExpanded] = useState(false);
3274
+ const [lastLineWidth, setLastLineWidth] = useState(null);
3275
+ const [textBoxWidth, setTextBoxWidth] = useState(null);
3276
+ const [metaWidth, setMetaWidth] = useState(null);
3277
+ const bubbleMaxWidth = Math.floor(screenWidth * 0.78);
3278
+ const mediaWidth = Math.min(bubbleMaxWidth - 6, 420);
3279
+ const sender = useUser(!isSelf ? message.sender_external_id : null);
3280
+ const senderFallbackName = message.sender_external_id ?? "Unknown";
3281
+ const senderLabel = sender.profile?.displayName ?? (message.sender_external_id ? labelFor?.(message.sender_external_id) ?? senderFallbackName : senderFallbackName);
3282
+ const senderTint = userColor(message.sender_external_id ?? message.sender_id ?? message.id);
3283
+ const tailCorner = groupPosition === "last" || groupPosition === "standalone";
3284
+ const bubbleRadius = theme.radii.bubble;
3285
+ const textColor = isSelf ? theme.colors.ownBubbleText : theme.colors.otherBubbleText;
3286
+ const mutedOnBubble = isSelf ? theme.colors.ownBubbleText : theme.colors.textSubtle;
3287
+ const radii2 = {
3288
+ topLeft: bubbleRadius,
3289
+ topRight: bubbleRadius,
3290
+ bottomLeft: bubbleRadius,
3291
+ bottomRight: bubbleRadius
3292
+ };
3293
+ if (tailCorner) {
3294
+ if (isSelf) radii2.bottomRight = 5;
3295
+ else radii2.bottomLeft = 5;
3296
+ }
3297
+ const body = message.body ?? "";
3298
+ const isDeleted = !!message.deleted_at;
3299
+ const isEdited = !!message.edited_at && !isDeleted;
3300
+ const trimmable = maxBodyLength > 0 && body.length > maxBodyLength;
3301
+ const truncated = trimmable && !expanded ? body.slice(0, maxBodyLength) + "\u2026" : body;
3302
+ const time = formatTime2(message.inserted_at, timeFormat);
3303
+ const images = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
3304
+ const files = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
3305
+ const hasMedia = images.length > 0;
3306
+ const hasFiles = files.length > 0;
3307
+ const hasBody = !isDeleted && body.length > 0;
3308
+ const metaOverlay = hasMedia && !hasBody && !hasFiles;
3309
+ const jumboCount = hasBody && !hasMedia && !hasFiles && !message.quoted_message_id ? emojiOnlyCount(body) : 0;
3128
3310
  const inlineMeta = hasBody && jumboCount === 0 && !trimmable && (!markdown || !hasMarkdown(truncated));
3129
3311
  const sectionAbove = hasMedia || hasFiles || !!message.quoted_message || isDeleted;
3130
3312
  const metaFits = lastLineWidth !== null && textBoxWidth !== null && metaWidth !== null && lastLineWidth + metaWidth + 14 <= textBoxWidth;
3131
3313
  const metaRow = (variant) => {
3132
- const color = variant === "overlay" ? "#FFFFFF" : variant === "jumbo" ? theme.colors.ink3 : mutedOnBubble;
3314
+ const color = variant === "overlay" ? "#FFFFFF" : variant === "jumbo" ? theme.colors.textSubtle : mutedOnBubble;
3133
3315
  return /* @__PURE__ */ jsxs(
3134
3316
  View,
3135
3317
  {
3136
3318
  style: [
3137
3319
  styles17.metaRow,
3138
3320
  variant === "inline" && styles17.metaInline,
3321
+ variant === "inline" && dense && styles17.metaInlineDense,
3139
3322
  variant === "wrapped" && styles17.metaWrapped,
3140
3323
  variant === "overlay" && styles17.metaOverlay,
3141
3324
  variant === "block" && styles17.metaBlock,
@@ -3174,7 +3357,7 @@ function MessageBubble({
3174
3357
  {
3175
3358
  style: [
3176
3359
  jumboCount === 0 && {
3177
- backgroundColor: isSelf ? theme.colors.selfBubble : theme.colors.otherBubble,
3360
+ backgroundColor: isSelf ? theme.colors.ownBubble : theme.colors.otherBubble,
3178
3361
  borderColor: isSelf ? "transparent" : theme.colors.border,
3179
3362
  borderWidth: isSelf ? 0 : StyleSheet.hairlineWidth,
3180
3363
  borderTopLeftRadius: radii2.topLeft,
@@ -3185,18 +3368,22 @@ function MessageBubble({
3185
3368
  jumboCount === 0 && theme.shadows.sm
3186
3369
  ],
3187
3370
  children: [
3188
- showSenderName && !isSelf && jumboCount === 0 && (groupPosition === "first" || groupPosition === "standalone") ? /* @__PURE__ */ jsx(
3189
- Text,
3190
- {
3191
- style: [styles17.senderName, { color: senderTint, fontFamily: theme.type.fontBody }],
3192
- ...onSenderPress ? {
3193
- onPress: onSenderPress,
3194
- accessibilityRole: "button",
3195
- suppressHighlighting: true
3196
- } : {},
3197
- children: senderLabel
3198
- }
3199
- ) : null,
3371
+ renderSlot(
3372
+ slots?.header,
3373
+ slotContext,
3374
+ showSenderName && !isSelf && jumboCount === 0 && (groupPosition === "first" || groupPosition === "standalone") ? /* @__PURE__ */ jsx(
3375
+ Text,
3376
+ {
3377
+ style: [styles17.senderName, { color: senderTint, fontFamily: theme.fonts.body }],
3378
+ ...onSenderPress ? {
3379
+ onPress: onSenderPress,
3380
+ accessibilityRole: "button",
3381
+ suppressHighlighting: true
3382
+ } : {},
3383
+ children: senderLabel
3384
+ }
3385
+ ) : null
3386
+ ),
3200
3387
  message.quoted_message ? /* @__PURE__ */ jsx(
3201
3388
  QuotedCard,
3202
3389
  {
@@ -3206,104 +3393,130 @@ function MessageBubble({
3206
3393
  ...onQuotedClick ? { onPress: () => onQuotedClick(message.quoted_message.id) } : {}
3207
3394
  }
3208
3395
  ) : null,
3209
- hasMedia ? (
3210
- // 3px of bubble color framing the picture; the mosaic clips
3211
- // itself 3px tighter than the bubble so the curves stay
3212
- // concentric.
3213
- /* @__PURE__ */ jsxs(View, { style: styles17.mediaFrame, children: [
3214
- /* @__PURE__ */ jsx(
3215
- ImageMosaic,
3396
+ renderSlot(
3397
+ slots?.attachments,
3398
+ slotContext,
3399
+ hasMedia || hasFiles ? /* @__PURE__ */ jsxs(Fragment, { children: [
3400
+ hasMedia ? (
3401
+ // 3px of bubble color framing the picture; the mosaic clips
3402
+ // itself 3px tighter than the bubble so the curves stay
3403
+ // concentric.
3404
+ /* @__PURE__ */ jsxs(View, { style: styles17.mediaFrame, children: [
3405
+ /* @__PURE__ */ jsx(
3406
+ ImageMosaic,
3407
+ {
3408
+ images,
3409
+ maxWidth: mediaWidth,
3410
+ radius: Math.max(bubbleRadius - 3, 8),
3411
+ squareBottom: !metaOverlay,
3412
+ ...onLongPress ? { onLongPress } : {}
3413
+ }
3414
+ ),
3415
+ metaOverlay ? metaRow("overlay") : null
3416
+ ] })
3417
+ ) : null,
3418
+ hasFiles ? /* @__PURE__ */ jsx(View, { style: styles17.filesBlock, children: files.map((att) => /* @__PURE__ */ jsx(
3419
+ AttachmentPreview,
3420
+ {
3421
+ attachment: att,
3422
+ maxWidth: bubbleMaxWidth - 12,
3423
+ tone: isSelf ? "onBrand" : "default"
3424
+ },
3425
+ att.id
3426
+ )) }) : null
3427
+ ] }) : null
3428
+ ),
3429
+ renderSlot(
3430
+ slots?.body,
3431
+ slotContext,
3432
+ /* @__PURE__ */ jsxs(Fragment, { children: [
3433
+ isDeleted ? /* @__PURE__ */ jsx(
3434
+ View,
3216
3435
  {
3217
- images,
3218
- maxWidth: mediaWidth,
3219
- radius: Math.max(bubbleRadius - 3, 8),
3220
- squareBottom: !metaOverlay,
3221
- ...onLongPress ? { onLongPress } : {}
3436
+ style: [
3437
+ styles17.textBlock,
3438
+ dense && styles17.textBlockDense,
3439
+ sectionAbove && styles17.textBlockAfter
3440
+ ],
3441
+ children: /* @__PURE__ */ jsx(
3442
+ Text,
3443
+ {
3444
+ style: {
3445
+ color: mutedOnBubble,
3446
+ opacity: 0.7,
3447
+ fontFamily: theme.fonts.body,
3448
+ fontSize: theme.fonts.sizeMd,
3449
+ lineHeight: theme.fonts.lineHeight,
3450
+ fontStyle: "italic"
3451
+ },
3452
+ children: "Message deleted"
3453
+ }
3454
+ )
3222
3455
  }
3223
- ),
3224
- metaOverlay ? metaRow("overlay") : null
3456
+ ) : null,
3457
+ hasBody && jumboCount > 0 ? /* @__PURE__ */ jsx(View, { style: styles17.jumboBlock, children: /* @__PURE__ */ jsx(
3458
+ Text,
3459
+ {
3460
+ style: {
3461
+ fontSize: emojiFontSize(jumboCount),
3462
+ lineHeight: emojiFontSize(jumboCount) + 8
3463
+ },
3464
+ children: body
3465
+ }
3466
+ ) }) : null,
3467
+ hasBody && jumboCount === 0 ? /* @__PURE__ */ jsxs(
3468
+ View,
3469
+ {
3470
+ style: [
3471
+ styles17.textBlock,
3472
+ dense && styles17.textBlockDense,
3473
+ sectionAbove && styles17.textBlockAfter
3474
+ ],
3475
+ onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
3476
+ children: [
3477
+ markdown && !inlineMeta ? renderMarkdown(truncated, {
3478
+ textColor,
3479
+ linkColor: isSelf ? theme.colors.ownBubbleText : theme.colors.link,
3480
+ fontFamily: theme.fonts.body,
3481
+ fontSize: theme.fonts.sizeMd,
3482
+ lineHeight: theme.fonts.lineHeight,
3483
+ onLinkPress: (url) => {
3484
+ void Linking.openURL(url).catch(() => void 0);
3485
+ return false;
3486
+ }
3487
+ }) : /* @__PURE__ */ jsx(
3488
+ Text,
3489
+ {
3490
+ style: {
3491
+ color: textColor,
3492
+ fontFamily: theme.fonts.body,
3493
+ fontSize: theme.fonts.sizeMd,
3494
+ lineHeight: theme.fonts.lineHeight
3495
+ },
3496
+ onTextLayout: inlineMeta ? (e) => {
3497
+ const lines = e.nativeEvent.lines;
3498
+ const last = lines[lines.length - 1];
3499
+ setLastLineWidth(last ? Math.ceil(last.width) : 0);
3500
+ } : void 0,
3501
+ children: truncated
3502
+ }
3503
+ ),
3504
+ trimmable ? /* @__PURE__ */ jsx(Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsx(
3505
+ Text,
3506
+ {
3507
+ style: [
3508
+ styles17.readMore,
3509
+ { color: isSelf ? theme.colors.ownBubbleText : theme.colors.link }
3510
+ ],
3511
+ children: expanded ? "Show less" : "Read more"
3512
+ }
3513
+ ) }) : null,
3514
+ inlineMeta ? metaRow(metaFits ? "inline" : "wrapped") : null
3515
+ ]
3516
+ }
3517
+ ) : null
3225
3518
  ] })
3226
- ) : null,
3227
- hasFiles ? /* @__PURE__ */ jsx(View, { style: styles17.filesBlock, children: files.map((att) => /* @__PURE__ */ jsx(
3228
- AttachmentPreview,
3229
- {
3230
- attachment: att,
3231
- maxWidth: bubbleMaxWidth - 12,
3232
- tone: isSelf ? "onBrand" : "default"
3233
- },
3234
- att.id
3235
- )) }) : null,
3236
- isDeleted ? /* @__PURE__ */ jsx(View, { style: [styles17.textBlock, sectionAbove && styles17.textBlockAfter], children: /* @__PURE__ */ jsx(
3237
- Text,
3238
- {
3239
- style: {
3240
- color: mutedOnBubble,
3241
- opacity: 0.7,
3242
- fontFamily: theme.type.fontBody,
3243
- fontSize: theme.type.bodySize,
3244
- lineHeight: theme.type.lineHeight,
3245
- fontStyle: "italic"
3246
- },
3247
- children: "Message deleted"
3248
- }
3249
- ) }) : null,
3250
- hasBody && jumboCount > 0 ? /* @__PURE__ */ jsx(View, { style: styles17.jumboBlock, children: /* @__PURE__ */ jsx(
3251
- Text,
3252
- {
3253
- style: {
3254
- fontSize: emojiFontSize(jumboCount),
3255
- lineHeight: emojiFontSize(jumboCount) + 8
3256
- },
3257
- children: body
3258
- }
3259
- ) }) : null,
3260
- hasBody && jumboCount === 0 ? /* @__PURE__ */ jsxs(
3261
- View,
3262
- {
3263
- style: [styles17.textBlock, sectionAbove && styles17.textBlockAfter],
3264
- onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
3265
- children: [
3266
- markdown && !inlineMeta ? renderMarkdown(truncated, {
3267
- textColor,
3268
- linkColor: isSelf ? theme.colors.onBrand : theme.colors.brand,
3269
- fontFamily: theme.type.fontBody,
3270
- fontSize: theme.type.bodySize,
3271
- lineHeight: theme.type.lineHeight,
3272
- onLinkPress: (url) => {
3273
- void Linking.openURL(url).catch(() => void 0);
3274
- return false;
3275
- }
3276
- }) : /* @__PURE__ */ jsx(
3277
- Text,
3278
- {
3279
- style: {
3280
- color: textColor,
3281
- fontFamily: theme.type.fontBody,
3282
- fontSize: theme.type.bodySize,
3283
- lineHeight: theme.type.lineHeight
3284
- },
3285
- onTextLayout: inlineMeta ? (e) => {
3286
- const lines = e.nativeEvent.lines;
3287
- const last = lines[lines.length - 1];
3288
- setLastLineWidth(last ? Math.ceil(last.width) : 0);
3289
- } : void 0,
3290
- children: truncated
3291
- }
3292
- ),
3293
- trimmable ? /* @__PURE__ */ jsx(Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsx(
3294
- Text,
3295
- {
3296
- style: [
3297
- styles17.readMore,
3298
- { color: isSelf ? theme.colors.onBrand : theme.colors.brand }
3299
- ],
3300
- children: expanded ? "Show less" : "Read more"
3301
- }
3302
- ) }) : null,
3303
- inlineMeta ? metaRow(metaFits ? "inline" : "wrapped") : null
3304
- ]
3305
- }
3306
- ) : null,
3519
+ ),
3307
3520
  !inlineMeta && !metaOverlay && jumboCount === 0 ? metaRow("block") : null,
3308
3521
  actionsTrigger ? /* @__PURE__ */ jsx(View, { style: styles17.actionsSlot, children: actionsTrigger }) : null
3309
3522
  ]
@@ -3320,12 +3533,12 @@ function QuotedCard({
3320
3533
  labelFor,
3321
3534
  onPress
3322
3535
  }) {
3323
- const theme = usePoolseTheme();
3536
+ const theme = useTheme();
3324
3537
  const resolved = useUser(quoted.sender_external_id);
3325
3538
  const senderName = quoted.sender_external_id ? labelFor?.(quoted.sender_external_id) ?? resolved.profile?.displayName ?? quoted.sender_external_id : "Unknown";
3326
- const bg = isSelf ? "rgba(0,0,0,0.16)" : theme.colors.surface2;
3327
- const accent = isSelf ? theme.colors.onBrand : theme.colors.brand;
3328
- const txt = isSelf ? theme.colors.onBrand : theme.colors.ink;
3539
+ const bg = isSelf ? "rgba(0,0,0,0.16)" : theme.colors.surfaceAlt;
3540
+ const accent = isSelf ? theme.colors.ownBubbleText : theme.colors.accent;
3541
+ const txt = isSelf ? theme.colors.ownBubbleText : theme.colors.text;
3329
3542
  return /* @__PURE__ */ jsxs(
3330
3543
  Pressable,
3331
3544
  {
@@ -3349,12 +3562,13 @@ function isImageContentType(ct) {
3349
3562
  if (!ct) return false;
3350
3563
  return ct.startsWith("image/");
3351
3564
  }
3352
- function formatTime2(iso) {
3565
+ function formatTime2(iso, format2) {
3353
3566
  try {
3354
3567
  const d = new Date(iso);
3568
+ if (typeof format2 === "function") return format2(d);
3355
3569
  const now = /* @__PURE__ */ new Date();
3356
3570
  const sameDay2 = isSameDay(d, now);
3357
- const time = d.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
3571
+ const time = formatClock(d, format2);
3358
3572
  if (sameDay2) return time;
3359
3573
  const yesterday = new Date(now);
3360
3574
  yesterday.setDate(now.getDate() - 1);
@@ -3394,6 +3608,9 @@ var styles17 = StyleSheet.create({
3394
3608
  paddingHorizontal: 12,
3395
3609
  paddingVertical: 7
3396
3610
  },
3611
+ textBlockDense: {
3612
+ paddingVertical: 4
3613
+ },
3397
3614
  // A hair less air when media / files / a quote already sit above.
3398
3615
  textBlockAfter: {
3399
3616
  paddingTop: 6
@@ -3425,6 +3642,10 @@ var styles17 = StyleSheet.create({
3425
3642
  // sat visibly low beside a one-line message.
3426
3643
  bottom: 11
3427
3644
  },
3645
+ // Same centring for the tighter `density="compact"` text block.
3646
+ metaInlineDense: {
3647
+ bottom: 8
3648
+ },
3428
3649
  metaOverlay: {
3429
3650
  position: "absolute",
3430
3651
  right: 6,
@@ -3491,7 +3712,7 @@ function ReactionStrip({
3491
3712
  meId,
3492
3713
  initialReactions
3493
3714
  }) {
3494
- const theme = usePoolseTheme();
3715
+ const theme = useTheme();
3495
3716
  const { reactions, addReaction, removeReaction } = useReactions(messageId, {
3496
3717
  conversationId,
3497
3718
  currentUserId: meId,
@@ -3509,8 +3730,8 @@ function ReactionStrip({
3509
3730
  style: [
3510
3731
  styles18.chip,
3511
3732
  {
3512
- backgroundColor: meReacted ? theme.colors.brandSoft : theme.colors.surface2,
3513
- borderColor: meReacted ? theme.colors.brand : theme.colors.border,
3733
+ backgroundColor: meReacted ? theme.colors.accentSoft : theme.colors.surfaceAlt,
3734
+ borderColor: meReacted ? theme.colors.accent : theme.colors.border,
3514
3735
  borderWidth: meReacted ? 1.5 : 1,
3515
3736
  transform: meReacted ? [{ scale: 1.04 }] : void 0
3516
3737
  }
@@ -3523,7 +3744,7 @@ function ReactionStrip({
3523
3744
  style: [
3524
3745
  styles18.count,
3525
3746
  {
3526
- color: meReacted ? theme.colors.brand : theme.colors.ink2,
3747
+ color: meReacted ? theme.colors.accent : theme.colors.textMuted,
3527
3748
  fontWeight: meReacted ? "700" : "600"
3528
3749
  }
3529
3750
  ],
@@ -3542,7 +3763,7 @@ function ReactionPicker({
3542
3763
  onPick,
3543
3764
  emojis = DEFAULT_EMOJIS
3544
3765
  }) {
3545
- const theme = usePoolseTheme();
3766
+ const theme = useTheme();
3546
3767
  const insets = useSafeInsets();
3547
3768
  return /* @__PURE__ */ jsx(
3548
3769
  Modal,
@@ -3643,6 +3864,378 @@ var styles18 = StyleSheet.create({
3643
3864
  lineHeight: 38
3644
3865
  }
3645
3866
  });
3867
+ var GUTTER = 40;
3868
+ function FlatMessageRow({
3869
+ msg,
3870
+ meId,
3871
+ layout,
3872
+ reactions = true,
3873
+ attachments = true,
3874
+ actions = true,
3875
+ threads = true,
3876
+ quotations = true,
3877
+ markdown = true,
3878
+ readState,
3879
+ isEditing = false,
3880
+ onStartEdit,
3881
+ onDelete,
3882
+ onOpenThread,
3883
+ onQuote,
3884
+ labelFor,
3885
+ onQuotedClick,
3886
+ groupPosition = "standalone",
3887
+ maxBodyLength = 0,
3888
+ showAvatar = layout === "list",
3889
+ avatarFor,
3890
+ onSenderPress,
3891
+ onAvatarPress,
3892
+ density = "comfortable",
3893
+ timeFormat,
3894
+ slots,
3895
+ mentionsMe = false
3896
+ }) {
3897
+ const theme = useTheme();
3898
+ const { width: screenWidth } = useWindowDimensions();
3899
+ const compact = layout === "compact";
3900
+ const dense = density === "compact";
3901
+ const isSelf = meId !== null && msg.sender_id === meId;
3902
+ const [actionsOpen, setActionsOpen] = useState(false);
3903
+ const [expanded, setExpanded] = useState(false);
3904
+ const reactionsApi = useReactions(msg.id, {
3905
+ conversationId: msg.conversation_id,
3906
+ currentUserId: meId,
3907
+ ...msg.reactions ? { initialReactions: msg.reactions } : {}
3908
+ });
3909
+ const resolved = useUser(msg.sender_external_id);
3910
+ const ext = msg.sender_external_id;
3911
+ const senderName = ext ? labelFor?.(ext) ?? resolved.profile?.displayName ?? ext : msg.sender_id ? `User ${msg.sender_id.slice(0, 6)}` : "Unknown";
3912
+ const avatarUrl = ext ? avatarFor?.(ext) ?? resolved.profile?.avatarUrl ?? null : null;
3913
+ const sender = {
3914
+ userId: msg.sender_id,
3915
+ externalId: ext,
3916
+ displayName: senderName,
3917
+ avatarUrl
3918
+ };
3919
+ const isRunStart = compact || groupPosition === "first" || groupPosition === "standalone";
3920
+ const ctx = { message: msg, isSelf, sender, layout, isRunStart };
3921
+ const deleted = !!msg.deleted_at;
3922
+ const time = formatMessageTime(msg.inserted_at, timeFormat);
3923
+ const openActions = () => {
3924
+ if (actions && !deleted) setActionsOpen(true);
3925
+ };
3926
+ const text = { fontFamily: theme.fonts.body, color: theme.colors.text };
3927
+ const avatarEl = showAvatar ? /* @__PURE__ */ jsx(Avatar, { src: avatarUrl, name: senderName, seed: ext, size: compact ? "xs" : "md" }) : null;
3928
+ const avatar = avatarEl && onAvatarPress && !isSelf ? /* @__PURE__ */ jsx(
3929
+ Pressable,
3930
+ {
3931
+ onPress: () => onAvatarPress(sender),
3932
+ accessibilityRole: "button",
3933
+ accessibilityLabel: senderName,
3934
+ hitSlop: 6,
3935
+ children: avatarEl
3936
+ }
3937
+ ) : avatarEl;
3938
+ const name = /* @__PURE__ */ jsx(
3939
+ Text,
3940
+ {
3941
+ style: [
3942
+ styles19.name,
3943
+ text,
3944
+ compact ? { color: userColor(ext ?? msg.sender_id ?? msg.id) } : null,
3945
+ compact ? styles19.nameCompact : null
3946
+ ],
3947
+ numberOfLines: 1,
3948
+ ...onSenderPress && !isSelf ? {
3949
+ onPress: () => onSenderPress(sender),
3950
+ accessibilityRole: "button",
3951
+ suppressHighlighting: true
3952
+ } : {},
3953
+ children: senderName
3954
+ }
3955
+ );
3956
+ const timeText = (dim) => /* @__PURE__ */ jsx(
3957
+ Text,
3958
+ {
3959
+ style: [
3960
+ styles19.time,
3961
+ { color: theme.colors.textSubtle, fontFamily: theme.fonts.body },
3962
+ dim ? styles19.timeDim : null
3963
+ ],
3964
+ children: time
3965
+ }
3966
+ );
3967
+ const header = compact ? name : isRunStart ? /* @__PURE__ */ jsxs(View, { style: styles19.header, children: [
3968
+ name,
3969
+ timeText(false)
3970
+ ] }) : null;
3971
+ const images = attachments && !deleted ? (msg.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
3972
+ const files = attachments && !deleted ? (msg.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
3973
+ const mediaWidth = Math.min(screenWidth - GUTTER - 48, 320);
3974
+ const attachmentsEl = images.length > 0 || files.length > 0 ? /* @__PURE__ */ jsxs(View, { style: styles19.attachments, children: [
3975
+ images.length > 0 ? /* @__PURE__ */ jsx(
3976
+ ImageMosaic,
3977
+ {
3978
+ images,
3979
+ maxWidth: mediaWidth,
3980
+ radius: theme.radii.md,
3981
+ onLongPress: openActions
3982
+ }
3983
+ ) : null,
3984
+ files.map((att) => /* @__PURE__ */ jsx(AttachmentPreview, { attachment: att, maxWidth: mediaWidth }, att.id))
3985
+ ] }) : null;
3986
+ const raw = msg.body ?? "";
3987
+ const trimmable = maxBodyLength > 0 && raw.length > maxBodyLength;
3988
+ const shown = trimmable && !expanded ? raw.slice(0, maxBodyLength) + "\u2026" : raw;
3989
+ const jumbo = raw && images.length === 0 && files.length === 0 && !msg.quoted_message_id ? emojiOnlyCount(raw) : 0;
3990
+ const bodyText = {
3991
+ ...text,
3992
+ fontSize: dense ? theme.fonts.sizeMd - 1 : theme.fonts.sizeMd,
3993
+ lineHeight: dense ? theme.fonts.lineHeight - 3 : theme.fonts.lineHeight
3994
+ };
3995
+ const edited = !!msg.edited_at && !deleted;
3996
+ const meta = edited || isSelf && readState ? /* @__PURE__ */ jsxs(View, { style: styles19.meta, children: [
3997
+ edited ? /* @__PURE__ */ jsx(Text, { style: [styles19.edited, { color: theme.colors.textSubtle }], children: "(edited)" }) : null,
3998
+ isSelf && readState ? /* @__PURE__ */ jsx(
3999
+ PoolseIcon,
4000
+ {
4001
+ name: readState === "read" ? "check-double" : "check",
4002
+ size: 13,
4003
+ color: readState === "read" ? theme.colors.accent : theme.colors.textSubtle
4004
+ }
4005
+ ) : null
4006
+ ] }) : null;
4007
+ const body = deleted ? /* @__PURE__ */ jsx(Text, { style: [bodyText, styles19.deleted, { color: theme.colors.textMuted }], children: "Message deleted" }) : raw ? /* @__PURE__ */ jsxs(View, { children: [
4008
+ jumbo > 0 ? /* @__PURE__ */ jsx(Text, { style: { fontSize: emojiFontSize(jumbo), lineHeight: emojiFontSize(jumbo) + 8 }, children: raw }) : markdown && hasMarkdown(shown) ? renderMarkdown(shown, {
4009
+ textColor: bodyText.color,
4010
+ linkColor: theme.colors.link,
4011
+ fontFamily: theme.fonts.body,
4012
+ fontSize: bodyText.fontSize,
4013
+ lineHeight: bodyText.lineHeight,
4014
+ onLinkPress: (url) => {
4015
+ void Linking.openURL(url).catch(() => void 0);
4016
+ return false;
4017
+ }
4018
+ }) : /* @__PURE__ */ jsx(Text, { style: bodyText, children: shown }),
4019
+ trimmable ? /* @__PURE__ */ jsx(Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsx(Text, { style: [styles19.readMore, { color: theme.colors.link }], children: expanded ? "Show less" : "Read more" }) }) : null,
4020
+ meta
4021
+ ] }) : meta;
4022
+ const replyCount = msg.reply_count ?? 0;
4023
+ const threadEl = threads && !deleted && !msg.thread_root_id && replyCount > 0 && onOpenThread ? /* @__PURE__ */ jsxs(Pressable, { onPress: onOpenThread, style: styles19.thread, accessibilityRole: "button", children: [
4024
+ /* @__PURE__ */ jsx(PoolseIcon, { name: "messages", size: 13, color: theme.colors.link }),
4025
+ /* @__PURE__ */ jsxs(Text, { style: [styles19.threadText, { color: theme.colors.link }], children: [
4026
+ replyCount,
4027
+ " ",
4028
+ replyCount === 1 ? "reply" : "replies"
4029
+ ] })
4030
+ ] }) : null;
4031
+ const reactionsEl = reactions && !deleted ? /* @__PURE__ */ jsx(View, { style: styles19.reactions, children: /* @__PURE__ */ jsx(
4032
+ ReactionStrip,
4033
+ {
4034
+ messageId: msg.id,
4035
+ conversationId: msg.conversation_id,
4036
+ meId,
4037
+ ...msg.reactions ? { initialReactions: msg.reactions } : {}
4038
+ }
4039
+ ) }) : null;
4040
+ const quote = msg.quoted_message ? /* @__PURE__ */ jsx(
4041
+ QuotedCard,
4042
+ {
4043
+ quoted: msg.quoted_message,
4044
+ isSelf: false,
4045
+ ...labelFor ? { labelFor } : {},
4046
+ ...onQuotedClick ? { onPress: () => onQuotedClick(msg.quoted_message.id) } : {}
4047
+ }
4048
+ ) : null;
4049
+ const content = /* @__PURE__ */ jsxs(View, { style: styles19.content, children: [
4050
+ !compact ? renderSlot(slots?.header, ctx, header) : null,
4051
+ quote,
4052
+ renderSlot(slots?.attachments, ctx, attachmentsEl),
4053
+ renderSlot(slots?.body, ctx, body),
4054
+ renderSlot(slots?.reactions, ctx, reactionsEl),
4055
+ renderSlot(slots?.thread, ctx, threadEl)
4056
+ ] });
4057
+ const close = () => setActionsOpen(false);
4058
+ const sheet = actions && actionsOpen ? /* @__PURE__ */ jsx(
4059
+ MessageActions,
4060
+ {
4061
+ visible: true,
4062
+ onClose: close,
4063
+ isSelf,
4064
+ ...reactions ? { onPickReaction: (emoji) => void reactionsApi.addReaction(emoji) } : {},
4065
+ ...msg.body && !deleted ? {
4066
+ onCopy: () => {
4067
+ close();
4068
+ void Clipboard.setStringAsync(msg.body ?? "");
4069
+ }
4070
+ } : {},
4071
+ ...onStartEdit ? {
4072
+ onEdit: () => {
4073
+ close();
4074
+ onStartEdit();
4075
+ }
4076
+ } : {},
4077
+ ...onDelete ? {
4078
+ onDelete: () => {
4079
+ close();
4080
+ onDelete();
4081
+ }
4082
+ } : {},
4083
+ ...threads && onOpenThread ? {
4084
+ onReplyInThread: () => {
4085
+ close();
4086
+ onOpenThread();
4087
+ }
4088
+ } : {},
4089
+ ...quotations && onQuote ? {
4090
+ onQuote: () => {
4091
+ close();
4092
+ onQuote();
4093
+ }
4094
+ } : {}
4095
+ }
4096
+ ) : null;
4097
+ return /* @__PURE__ */ jsxs(
4098
+ View,
4099
+ {
4100
+ style: [
4101
+ styles19.row,
4102
+ compact ? styles19.rowCompact : null,
4103
+ dense ? styles19.rowDense : null,
4104
+ !compact && isRunStart ? dense ? styles19.runStartDense : styles19.runStart : null,
4105
+ mentionsMe ? { backgroundColor: theme.colors.mention, borderLeftColor: theme.colors.accent } : null,
4106
+ isEditing ? styles19.rowEditing : null
4107
+ ],
4108
+ children: [
4109
+ /* @__PURE__ */ jsx(
4110
+ Pressable,
4111
+ {
4112
+ onLongPress: openActions,
4113
+ style: [styles19.line, compact ? styles19.lineCompact : null],
4114
+ accessibilityRole: "button",
4115
+ accessibilityLabel: "Message actions",
4116
+ children: compact ? /* @__PURE__ */ jsxs(Fragment, { children: [
4117
+ timeText(false),
4118
+ avatar ? /* @__PURE__ */ jsx(View, { style: styles19.avatarCompact, children: avatar }) : null,
4119
+ renderSlot(slots?.header, ctx, header),
4120
+ content
4121
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
4122
+ /* @__PURE__ */ jsx(View, { style: styles19.gutter, children: isRunStart ? avatar : timeText(true) }),
4123
+ content
4124
+ ] })
4125
+ }
4126
+ ),
4127
+ renderSlot(slots?.actions, ctx, sheet)
4128
+ ]
4129
+ }
4130
+ );
4131
+ }
4132
+ var styles19 = StyleSheet.create({
4133
+ row: {
4134
+ // 3px left border reserved for the mention accent bar.
4135
+ borderLeftWidth: 3,
4136
+ borderLeftColor: "transparent",
4137
+ paddingLeft: 9,
4138
+ paddingRight: 12,
4139
+ paddingVertical: 2
4140
+ },
4141
+ rowCompact: {
4142
+ paddingVertical: 1
4143
+ },
4144
+ rowDense: {
4145
+ paddingVertical: 0
4146
+ },
4147
+ runStart: {
4148
+ marginTop: 8,
4149
+ paddingTop: 4
4150
+ },
4151
+ runStartDense: {
4152
+ marginTop: 4,
4153
+ paddingTop: 2
4154
+ },
4155
+ rowEditing: {
4156
+ // Above ConversationView's edit backdrop, like the bubble row.
4157
+ zIndex: 10,
4158
+ elevation: 10
4159
+ },
4160
+ line: {
4161
+ flexDirection: "row",
4162
+ alignItems: "flex-start",
4163
+ gap: 8
4164
+ },
4165
+ lineCompact: {
4166
+ gap: 6
4167
+ },
4168
+ gutter: {
4169
+ width: GUTTER,
4170
+ alignItems: "center"
4171
+ },
4172
+ avatarCompact: {
4173
+ marginTop: 1
4174
+ },
4175
+ content: {
4176
+ flex: 1,
4177
+ minWidth: 0
4178
+ },
4179
+ header: {
4180
+ flexDirection: "row",
4181
+ alignItems: "baseline",
4182
+ gap: 8
4183
+ },
4184
+ name: {
4185
+ fontSize: 14,
4186
+ fontWeight: "700",
4187
+ flexShrink: 1
4188
+ },
4189
+ nameCompact: {
4190
+ maxWidth: "35%",
4191
+ flexShrink: 0
4192
+ },
4193
+ time: {
4194
+ fontSize: 11,
4195
+ fontVariant: ["tabular-nums"],
4196
+ lineHeight: 20
4197
+ },
4198
+ timeDim: {
4199
+ fontSize: 10,
4200
+ opacity: 0.7
4201
+ },
4202
+ attachments: {
4203
+ marginVertical: 4,
4204
+ gap: 4
4205
+ },
4206
+ deleted: {
4207
+ fontStyle: "italic"
4208
+ },
4209
+ readMore: {
4210
+ fontSize: 12,
4211
+ fontWeight: "600",
4212
+ marginTop: 2
4213
+ },
4214
+ meta: {
4215
+ flexDirection: "row",
4216
+ alignItems: "center",
4217
+ gap: 4,
4218
+ marginTop: 1
4219
+ },
4220
+ edited: {
4221
+ fontSize: 11
4222
+ },
4223
+ reactions: {
4224
+ marginTop: 4,
4225
+ alignSelf: "flex-start"
4226
+ },
4227
+ thread: {
4228
+ flexDirection: "row",
4229
+ alignItems: "center",
4230
+ gap: 4,
4231
+ marginTop: 4,
4232
+ alignSelf: "flex-start"
4233
+ },
4234
+ threadText: {
4235
+ fontSize: 12.5,
4236
+ fontWeight: "600"
4237
+ }
4238
+ });
3646
4239
  var SWIPE_REPLY_THRESHOLD = 50;
3647
4240
  function MessageRow(props) {
3648
4241
  const callLog = callLogDisplayFor(props.msg, props.meId);
@@ -3656,6 +4249,9 @@ function MessageRow(props) {
3656
4249
  }
3657
4250
  ) : null;
3658
4251
  }
4252
+ if (props.layout === "list" || props.layout === "compact") {
4253
+ return /* @__PURE__ */ jsx(FlatMessageRow, { ...props, layout: props.layout });
4254
+ }
3659
4255
  return /* @__PURE__ */ jsx(BubbleMessageRow, { ...props });
3660
4256
  }
3661
4257
  function BubbleMessageRow({
@@ -3681,9 +4277,12 @@ function BubbleMessageRow({
3681
4277
  showAvatar = false,
3682
4278
  avatarFor,
3683
4279
  onSenderPress,
3684
- onAvatarPress
4280
+ onAvatarPress,
4281
+ density = "comfortable",
4282
+ timeFormat,
4283
+ slots
3685
4284
  }) {
3686
- const theme = usePoolseTheme();
4285
+ const theme = useTheme();
3687
4286
  const isSelf = meId !== null && msg.sender_id === meId;
3688
4287
  const [actionsOpen, setActionsOpen] = useState(false);
3689
4288
  const reactionsApi = useReactions(msg.id, {
@@ -3774,6 +4373,13 @@ function BubbleMessageRow({
3774
4373
  displayName: senderLabel ?? "Unknown",
3775
4374
  avatarUrl
3776
4375
  };
4376
+ const slotContext = {
4377
+ message: msg,
4378
+ isSelf,
4379
+ sender,
4380
+ layout: "bubbles",
4381
+ isRunStart: groupPosition === "first" || groupPosition === "standalone"
4382
+ };
3777
4383
  const avatar = /* @__PURE__ */ jsx(
3778
4384
  Avatar,
3779
4385
  {
@@ -3787,15 +4393,16 @@ function BubbleMessageRow({
3787
4393
  View,
3788
4394
  {
3789
4395
  style: [
3790
- styles19.row,
4396
+ styles20.row,
3791
4397
  { alignSelf: isSelf ? "flex-end" : "flex-start" },
4398
+ density === "compact" ? styles20.rowDense : null,
3792
4399
  // Lift this row above the dim backdrop the parent renders
3793
4400
  // during edit mode. zIndex covers iOS / web; elevation does
3794
4401
  // the equivalent on Android.
3795
- isEditing ? styles19.rowEditing : null
4402
+ isEditing ? styles20.rowEditing : null
3796
4403
  ],
3797
4404
  children: [
3798
- showAvatarSlot ? /* @__PURE__ */ jsx(View, { style: styles19.avatarSlot, children: !showAvatarRender ? null : onAvatarPress ? /* @__PURE__ */ jsx(
4405
+ showAvatarSlot ? /* @__PURE__ */ jsx(View, { style: styles20.avatarSlot, children: !showAvatarRender ? null : onAvatarPress ? /* @__PURE__ */ jsx(
3799
4406
  Pressable,
3800
4407
  {
3801
4408
  onPress: () => onAvatarPress(sender),
@@ -3805,21 +4412,21 @@ function BubbleMessageRow({
3805
4412
  children: avatar
3806
4413
  }
3807
4414
  ) : avatar }) : null,
3808
- /* @__PURE__ */ jsxs(View, { style: styles19.bubbleCol, children: [
4415
+ /* @__PURE__ */ jsxs(View, { style: styles20.bubbleCol, children: [
3809
4416
  swipeEnabled ? /* @__PURE__ */ jsx(
3810
4417
  Animated.View,
3811
4418
  {
3812
4419
  pointerEvents: "none",
3813
4420
  style: [
3814
- styles19.replyHint,
3815
- isSelf ? styles19.replyHintRight : styles19.replyHintLeft,
4421
+ styles20.replyHint,
4422
+ isSelf ? styles20.replyHintRight : styles20.replyHintLeft,
3816
4423
  {
3817
4424
  opacity: replyIconOpacity,
3818
4425
  transform: [{ scale: replyIconScale }],
3819
- backgroundColor: theme.colors.surface2
4426
+ backgroundColor: theme.colors.surfaceAlt
3820
4427
  }
3821
4428
  ],
3822
- children: /* @__PURE__ */ jsx(PoolseIcon, { name: "reply", size: 16, color: theme.colors.brand })
4429
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: "reply", size: 16, color: theme.colors.accent })
3823
4430
  }
3824
4431
  ) : null,
3825
4432
  /* @__PURE__ */ jsx(
@@ -3850,6 +4457,9 @@ function BubbleMessageRow({
3850
4457
  ...onSenderPress ? { onSenderPress: () => onSenderPress(sender) } : {},
3851
4458
  showAttachments: attachments,
3852
4459
  markdown,
4460
+ density,
4461
+ ...timeFormat ? { timeFormat } : {},
4462
+ ...slots ? { slots, slotContext } : {},
3853
4463
  onLongPress: () => {
3854
4464
  if (actions) setActionsOpen(true);
3855
4465
  }
@@ -3859,72 +4469,84 @@ function BubbleMessageRow({
3859
4469
  )
3860
4470
  }
3861
4471
  ),
3862
- threads && (msg.reply_count ?? 0) > 0 && onOpenThread ? /* @__PURE__ */ jsx(Pressable, { onPress: onOpenThread, style: styles19.threadPill, children: /* @__PURE__ */ jsxs(Text, { style: [styles19.threadPillText, { color: theme.colors.brand }], children: [
3863
- "\u{1F4AC} ",
3864
- msg.reply_count,
3865
- " ",
3866
- msg.reply_count === 1 ? "reply" : "replies"
3867
- ] }) }) : null,
3868
- reactions ? /* @__PURE__ */ jsx(View, { style: [styles19.reactionsRow, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: /* @__PURE__ */ jsx(
3869
- ReactionStrip,
4472
+ renderSlot(
4473
+ slots?.thread,
4474
+ slotContext,
4475
+ threads && (msg.reply_count ?? 0) > 0 && onOpenThread ? /* @__PURE__ */ jsx(Pressable, { onPress: onOpenThread, style: styles20.threadPill, children: /* @__PURE__ */ jsxs(Text, { style: [styles20.threadPillText, { color: theme.colors.accent }], children: [
4476
+ "\u{1F4AC} ",
4477
+ msg.reply_count,
4478
+ " ",
4479
+ msg.reply_count === 1 ? "reply" : "replies"
4480
+ ] }) }) : null
4481
+ ),
4482
+ renderSlot(
4483
+ slots?.reactions,
4484
+ slotContext,
4485
+ reactions ? /* @__PURE__ */ jsx(View, { style: [styles20.reactionsRow, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: /* @__PURE__ */ jsx(
4486
+ ReactionStrip,
4487
+ {
4488
+ messageId: msg.id,
4489
+ conversationId: msg.conversation_id,
4490
+ meId,
4491
+ ...msg.reactions ? { initialReactions: msg.reactions } : {}
4492
+ }
4493
+ ) }) : null
4494
+ )
4495
+ ] }),
4496
+ renderSlot(
4497
+ slots?.actions,
4498
+ slotContext,
4499
+ actions && actionsOpen ? /* @__PURE__ */ jsx(
4500
+ MessageActions,
3870
4501
  {
3871
- messageId: msg.id,
3872
- conversationId: msg.conversation_id,
3873
- meId,
3874
- ...msg.reactions ? { initialReactions: msg.reactions } : {}
4502
+ visible: actionsOpen,
4503
+ onClose: () => setActionsOpen(false),
4504
+ isSelf,
4505
+ ...reactions ? {
4506
+ // Inline quick-react row at the top of the sheet —
4507
+ // one tap = react + close, no second modal needed.
4508
+ onPickReaction: (emoji) => {
4509
+ void reactionsApi.addReaction(emoji);
4510
+ }
4511
+ } : {},
4512
+ ...msg.body && !msg.deleted_at ? {
4513
+ onCopy: () => {
4514
+ setActionsOpen(false);
4515
+ void Clipboard.setStringAsync(msg.body ?? "");
4516
+ }
4517
+ } : {},
4518
+ ...onStartEdit ? {
4519
+ onEdit: () => {
4520
+ setActionsOpen(false);
4521
+ onStartEdit();
4522
+ }
4523
+ } : {},
4524
+ ...onDelete ? {
4525
+ onDelete: () => {
4526
+ setActionsOpen(false);
4527
+ onDelete();
4528
+ }
4529
+ } : {},
4530
+ ...onOpenThread ? {
4531
+ onReplyInThread: () => {
4532
+ setActionsOpen(false);
4533
+ onOpenThread();
4534
+ }
4535
+ } : {},
4536
+ ...quotations && onQuote ? {
4537
+ onQuote: () => {
4538
+ setActionsOpen(false);
4539
+ onQuote();
4540
+ }
4541
+ } : {}
3875
4542
  }
3876
- ) }) : null
3877
- ] }),
3878
- actions && actionsOpen ? /* @__PURE__ */ jsx(
3879
- MessageActions,
3880
- {
3881
- visible: actionsOpen,
3882
- onClose: () => setActionsOpen(false),
3883
- isSelf,
3884
- ...reactions ? {
3885
- // Inline quick-react row at the top of the sheet —
3886
- // one tap = react + close, no second modal needed.
3887
- onPickReaction: (emoji) => {
3888
- void reactionsApi.addReaction(emoji);
3889
- }
3890
- } : {},
3891
- ...msg.body && !msg.deleted_at ? {
3892
- onCopy: () => {
3893
- setActionsOpen(false);
3894
- void Clipboard.setStringAsync(msg.body ?? "");
3895
- }
3896
- } : {},
3897
- ...onStartEdit ? {
3898
- onEdit: () => {
3899
- setActionsOpen(false);
3900
- onStartEdit();
3901
- }
3902
- } : {},
3903
- ...onDelete ? {
3904
- onDelete: () => {
3905
- setActionsOpen(false);
3906
- onDelete();
3907
- }
3908
- } : {},
3909
- ...onOpenThread ? {
3910
- onReplyInThread: () => {
3911
- setActionsOpen(false);
3912
- onOpenThread();
3913
- }
3914
- } : {},
3915
- ...quotations && onQuote ? {
3916
- onQuote: () => {
3917
- setActionsOpen(false);
3918
- onQuote();
3919
- }
3920
- } : {}
3921
- }
3922
- ) : null
4543
+ ) : null
4544
+ )
3923
4545
  ]
3924
4546
  }
3925
4547
  );
3926
4548
  }
3927
- var styles19 = StyleSheet.create({
4549
+ var styles20 = StyleSheet.create({
3928
4550
  row: {
3929
4551
  flexDirection: "row",
3930
4552
  alignItems: "flex-end",
@@ -3938,6 +4560,9 @@ var styles19 = StyleSheet.create({
3938
4560
  paddingHorizontal: 10,
3939
4561
  maxWidth: "95%"
3940
4562
  },
4563
+ rowDense: {
4564
+ marginVertical: 0
4565
+ },
3941
4566
  rowEditing: {
3942
4567
  // Above ConversationView's editBackdrop (zIndex 5). Elevation
3943
4568
  // does the equivalent stacking on Android.
@@ -3990,7 +4615,9 @@ function ThreadView({
3990
4615
  conversationId,
3991
4616
  rootMessage,
3992
4617
  labelFor,
3993
- avatarFor
4618
+ avatarFor,
4619
+ layout,
4620
+ timeFormat
3994
4621
  }) {
3995
4622
  return /* @__PURE__ */ jsx(
3996
4623
  Modal,
@@ -4007,7 +4634,9 @@ function ThreadView({
4007
4634
  conversationId,
4008
4635
  rootMessage,
4009
4636
  ...labelFor ? { labelFor } : {},
4010
- ...avatarFor ? { avatarFor } : {}
4637
+ ...avatarFor ? { avatarFor } : {},
4638
+ ...layout ? { layout } : {},
4639
+ ...timeFormat ? { timeFormat } : {}
4011
4640
  }
4012
4641
  ) })
4013
4642
  }
@@ -4018,9 +4647,11 @@ function ThreadSheet({
4018
4647
  conversationId,
4019
4648
  rootMessage,
4020
4649
  labelFor,
4021
- avatarFor
4650
+ avatarFor,
4651
+ layout,
4652
+ timeFormat
4022
4653
  }) {
4023
- const theme = usePoolseTheme();
4654
+ const theme = useTheme();
4024
4655
  const { me } = useMe();
4025
4656
  const meId = me?.id ?? null;
4026
4657
  const {
@@ -4063,11 +4694,13 @@ function ThreadSheet({
4063
4694
  void deleteReply(msg.id);
4064
4695
  },
4065
4696
  ...labelFor ? { labelFor } : {},
4066
- ...avatarFor ? { avatarFor } : {}
4697
+ ...avatarFor ? { avatarFor } : {},
4698
+ ...layout ? { layout } : {},
4699
+ ...timeFormat ? { timeFormat } : {}
4067
4700
  }
4068
4701
  );
4069
4702
  },
4070
- [meId, editingId, deleteReply, labelFor, avatarFor]
4703
+ [meId, editingId, deleteReply, labelFor, avatarFor, layout, timeFormat]
4071
4704
  );
4072
4705
  const editingMessage = useMemo(
4073
4706
  () => editingId ? replies.find((m) => m.id === editingId) ?? null : null,
@@ -4085,26 +4718,28 @@ function ThreadSheet({
4085
4718
  threads: false,
4086
4719
  quotations: false,
4087
4720
  ...labelFor ? { labelFor } : {},
4088
- ...avatarFor ? { avatarFor } : {}
4721
+ ...avatarFor ? { avatarFor } : {},
4722
+ ...layout ? { layout } : {},
4723
+ ...timeFormat ? { timeFormat } : {}
4089
4724
  }
4090
4725
  ),
4091
- [rootMessage, meId, labelFor, avatarFor]
4726
+ [rootMessage, meId, labelFor, avatarFor, layout, timeFormat]
4092
4727
  );
4093
4728
  return /* @__PURE__ */ jsxs(
4094
4729
  View,
4095
4730
  {
4096
- style: styles20.modalRoot,
4731
+ style: styles21.modalRoot,
4097
4732
  onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
4098
4733
  children: [
4099
- /* @__PURE__ */ jsx(Pressable, { style: styles20.backdrop, onPress: onClose, accessibilityLabel: "Close thread" }),
4734
+ /* @__PURE__ */ jsx(Pressable, { style: styles21.backdrop, onPress: onClose, accessibilityLabel: "Close thread" }),
4100
4735
  /* @__PURE__ */ jsxs(
4101
4736
  Animated.View,
4102
4737
  {
4103
4738
  style: [
4104
- styles20.sheet,
4739
+ styles21.sheet,
4105
4740
  {
4106
4741
  height: sheetHeight,
4107
- backgroundColor: theme.colors.paper,
4742
+ backgroundColor: theme.colors.background,
4108
4743
  borderTopLeftRadius: theme.radii.xl,
4109
4744
  borderTopRightRadius: theme.radii.xl,
4110
4745
  paddingLeft: insets.left,
@@ -4115,25 +4750,22 @@ function ThreadSheet({
4115
4750
  ],
4116
4751
  children: [
4117
4752
  /* @__PURE__ */ jsxs(View, { ...panHandlers, children: [
4118
- /* @__PURE__ */ jsx(View, { style: styles20.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles20.dragPill, { backgroundColor: theme.colors.ink3 }] }) }),
4119
- /* @__PURE__ */ jsxs(View, { style: [styles20.header, { borderBottomColor: theme.colors.border }], children: [
4753
+ /* @__PURE__ */ jsx(View, { style: styles21.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles21.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
4754
+ /* @__PURE__ */ jsxs(View, { style: [styles21.header, { borderBottomColor: theme.colors.border }], children: [
4120
4755
  /* @__PURE__ */ jsx(
4121
4756
  Pressable,
4122
4757
  {
4123
4758
  onPress: onClose,
4124
4759
  hitSlop: 16,
4125
- style: [styles20.closeBtn, { backgroundColor: theme.colors.surface2 }],
4760
+ style: [styles21.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
4126
4761
  accessibilityLabel: "Close thread",
4127
- children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.ink })
4762
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
4128
4763
  }
4129
4764
  ),
4130
4765
  /* @__PURE__ */ jsx(
4131
4766
  Text,
4132
4767
  {
4133
- style: [
4134
- styles20.title,
4135
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
4136
- ],
4768
+ style: [styles21.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
4137
4769
  children: "Thread"
4138
4770
  }
4139
4771
  )
@@ -4142,12 +4774,12 @@ function ThreadSheet({
4142
4774
  /* @__PURE__ */ jsxs(
4143
4775
  KeyboardAvoidingView,
4144
4776
  {
4145
- style: styles20.kavBody,
4777
+ style: styles21.kavBody,
4146
4778
  behavior: "padding",
4147
4779
  keyboardVerticalOffset: gutter,
4148
4780
  children: [
4149
- /* @__PURE__ */ jsx(View, { style: [styles20.rootPreview, { backgroundColor: theme.colors.surface2 }], children: rootRow }),
4150
- /* @__PURE__ */ jsx(View, { style: styles20.listWrap, children: /* @__PURE__ */ jsx(
4781
+ /* @__PURE__ */ jsx(View, { style: [styles21.rootPreview, { backgroundColor: theme.colors.surfaceAlt }], children: rootRow }),
4782
+ /* @__PURE__ */ jsx(View, { style: styles21.listWrap, children: /* @__PURE__ */ jsx(
4151
4783
  MessageList,
4152
4784
  {
4153
4785
  messages: replies,
@@ -4185,7 +4817,7 @@ function ThreadSheet({
4185
4817
  }
4186
4818
  );
4187
4819
  }
4188
- var styles20 = StyleSheet.create({
4820
+ var styles21 = StyleSheet.create({
4189
4821
  modalRoot: {
4190
4822
  flex: 1,
4191
4823
  justifyContent: "flex-end"
@@ -4240,9 +4872,9 @@ var styles20 = StyleSheet.create({
4240
4872
  }
4241
4873
  });
4242
4874
  function UserName({ externalId, fallback, labelFor }) {
4243
- const theme = usePoolseTheme();
4875
+ const theme = useTheme();
4244
4876
  const name = useDisplayName(externalId, labelFor) ?? fallback ?? externalId ?? "";
4245
- return /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.ink, fontFamily: theme.type.fontBody }, children: name });
4877
+ return /* @__PURE__ */ jsx(Text, { style: { color: theme.colors.text, fontFamily: theme.fonts.body }, children: name });
4246
4878
  }
4247
4879
  function useDisplayName(externalId, labelFor) {
4248
4880
  const resolved = useUser(externalId ?? null);
@@ -4257,13 +4889,13 @@ function TypingIndicator({ typing, labelFor }) {
4257
4889
  const ids = Array.from(typing);
4258
4890
  const isTyping = ids.length > 0;
4259
4891
  if (!isTyping) return /* @__PURE__ */ jsx(View, { style: { height: 0 } });
4260
- return /* @__PURE__ */ jsxs(View, { style: styles21.row, children: [
4892
+ return /* @__PURE__ */ jsxs(View, { style: styles22.row, children: [
4261
4893
  /* @__PURE__ */ jsx(TypingDots, {}),
4262
4894
  /* @__PURE__ */ jsx(TypingLabel, { ids, ...labelFor ? { labelFor } : {} })
4263
4895
  ] });
4264
4896
  }
4265
4897
  function TypingDots() {
4266
- const theme = usePoolseTheme();
4898
+ const theme = useTheme();
4267
4899
  const a = useRef(new Animated.Value(0)).current;
4268
4900
  const b = useRef(new Animated.Value(0)).current;
4269
4901
  const c = useRef(new Animated.Value(0)).current;
@@ -4293,7 +4925,7 @@ function TypingDots() {
4293
4925
  width: 6,
4294
4926
  height: 6,
4295
4927
  borderRadius: 3,
4296
- backgroundColor: theme.colors.ink3,
4928
+ backgroundColor: theme.colors.textSubtle,
4297
4929
  marginHorizontal: 2,
4298
4930
  transform: [
4299
4931
  {
@@ -4302,7 +4934,7 @@ function TypingDots() {
4302
4934
  ],
4303
4935
  opacity: val.interpolate({ inputRange: [0, 1], outputRange: [0.5, 1] })
4304
4936
  });
4305
- return /* @__PURE__ */ jsxs(View, { style: styles21.dotsWrap, children: [
4937
+ return /* @__PURE__ */ jsxs(View, { style: styles22.dotsWrap, children: [
4306
4938
  /* @__PURE__ */ jsx(Animated.View, { style: dot(a) }),
4307
4939
  /* @__PURE__ */ jsx(Animated.View, { style: dot(b) }),
4308
4940
  /* @__PURE__ */ jsx(Animated.View, { style: dot(c) })
@@ -4312,15 +4944,15 @@ function TypingLabel({
4312
4944
  ids,
4313
4945
  labelFor
4314
4946
  }) {
4315
- const theme = usePoolseTheme();
4947
+ const theme = useTheme();
4316
4948
  const id1 = ids[0] ?? null;
4317
4949
  const id2 = ids[1] ?? null;
4318
4950
  const name1 = useDisplayName(id1, labelFor);
4319
4951
  const name2 = useDisplayName(id2, labelFor);
4320
4952
  const text = ids.length === 1 ? `${name1} is typing` : ids.length === 2 ? `${name1} and ${name2} are typing` : `${ids.length} people are typing`;
4321
- return /* @__PURE__ */ jsx(Text, { style: [styles21.label, { color: theme.colors.ink2, fontFamily: theme.type.fontBody }], children: text });
4953
+ return /* @__PURE__ */ jsx(Text, { style: [styles22.label, { color: theme.colors.textMuted, fontFamily: theme.fonts.body }], children: text });
4322
4954
  }
4323
- var styles21 = StyleSheet.create({
4955
+ var styles22 = StyleSheet.create({
4324
4956
  row: {
4325
4957
  flexDirection: "row",
4326
4958
  alignItems: "center",
@@ -4337,7 +4969,7 @@ var styles21 = StyleSheet.create({
4337
4969
  fontSize: 12
4338
4970
  }
4339
4971
  });
4340
- var GROUPING_WINDOW_MS = 5 * 60 * 1e3;
4972
+ var GROUP_WINDOW_MINUTES = 5;
4341
4973
  function ConversationView({
4342
4974
  conversationId,
4343
4975
  emptyState,
@@ -4369,9 +5001,16 @@ function ConversationView({
4369
5001
  keyboardOffset = 0,
4370
5002
  onCallBack,
4371
5003
  onJoinCall,
4372
- currentCallId = null
5004
+ currentCallId = null,
5005
+ layout = "bubbles",
5006
+ density = "comfortable",
5007
+ showAvatars: showAvatarsProp,
5008
+ timeFormat,
5009
+ groupWindowMinutes = GROUP_WINDOW_MINUTES,
5010
+ daySeparators = true,
5011
+ slots
4373
5012
  }) {
4374
- const theme = usePoolseTheme();
5013
+ const theme = useTheme();
4375
5014
  const showComposer = composer && !readOnly;
4376
5015
  const canQuote = quotations && showComposer;
4377
5016
  const canAttach = attachments && showComposer;
@@ -4420,7 +5059,16 @@ function ConversationView({
4420
5059
  const { members } = useMembers(wantsMembers ? conversationId : "");
4421
5060
  const isGroupChat = members.length > 2;
4422
5061
  const showSenderLabels = senderLabels === "always" || senderLabels === "auto" && isGroupChat;
4423
- const showAvatars = avatars === "always" || avatars === "auto" && isGroupChat;
5062
+ const showAvatars = showAvatarsProp ?? (layout === "list" ? true : layout === "compact" ? false : avatars === "always" || avatars === "auto" && isGroupChat);
5063
+ const layoutProps = useMemo(
5064
+ () => ({
5065
+ layout,
5066
+ density,
5067
+ ...timeFormat ? { timeFormat } : {},
5068
+ ...slots ? { slots } : {}
5069
+ }),
5070
+ [layout, density, timeFormat, slots]
5071
+ );
4424
5072
  const [replyingTo, setReplyingTo] = useState(null);
4425
5073
  const [editingId, setEditingId] = useState(null);
4426
5074
  const [threadRoot, setThreadRoot] = useState(null);
@@ -4508,16 +5156,12 @@ function ConversationView({
4508
5156
  if (!msg) continue;
4509
5157
  const prev = i > 0 ? visibleMessages[i - 1] ?? null : null;
4510
5158
  const next = i < visibleMessages.length - 1 ? visibleMessages[i + 1] ?? null : null;
4511
- map.set(msg.id, computeGroupPosition(msg, prev, next, GROUPING_WINDOW_MS));
5159
+ map.set(msg.id, computeGroupPosition(msg, prev, next, groupWindowMinutes * 60 * 1e3));
4512
5160
  }
4513
5161
  return map;
4514
- }, [visibleMessages]);
4515
- const renderItem = useCallback(
4516
- (msg) => {
4517
- if (renderMessage) {
4518
- const custom = renderMessage(msg, meId);
4519
- if (custom !== null && custom !== void 0) return custom;
4520
- }
5162
+ }, [visibleMessages, groupWindowMinutes]);
5163
+ const defaultRow = useCallback(
5164
+ (msg, groupPosition) => {
4521
5165
  const readState = showReadState && meId !== null && msg.sender_id === meId ? readStateForMessage(msg, members, meId, sequenceByMessageId) : void 0;
4522
5166
  const isSelf = meId !== null && msg.sender_id === meId;
4523
5167
  const canEdit = canEditOwnMessage({
@@ -4527,7 +5171,6 @@ function ConversationView({
4527
5171
  readState,
4528
5172
  insertedAt: msg.inserted_at
4529
5173
  });
4530
- const groupPosition = groupPositionById.get(msg.id) ?? "standalone";
4531
5174
  const row = /* @__PURE__ */ jsx(
4532
5175
  MessageRow,
4533
5176
  {
@@ -4554,11 +5197,13 @@ function ConversationView({
4554
5197
  maxBodyLength,
4555
5198
  groupPosition,
4556
5199
  markdown,
4557
- ...onCallBack ? { onCallBack } : {}
5200
+ ...onCallBack ? { onCallBack } : {},
5201
+ ...layoutProps,
5202
+ mentionsMe: mentionsViewer(msg, meId)
4558
5203
  }
4559
5204
  );
4560
5205
  if (msg.id !== highlightId) return row;
4561
- return /* @__PURE__ */ jsx(View, { style: { backgroundColor: theme.colors.brandSoft }, children: row });
5206
+ return /* @__PURE__ */ jsx(View, { style: { backgroundColor: theme.colors.accentSoft }, children: row });
4562
5207
  },
4563
5208
  [
4564
5209
  onCallBack,
@@ -4566,9 +5211,8 @@ function ConversationView({
4566
5211
  onSenderPress,
4567
5212
  onAvatarPress,
4568
5213
  highlightId,
4569
- theme.colors.brandSoft,
5214
+ theme.colors.accentSoft,
4570
5215
  canQuote,
4571
- renderMessage,
4572
5216
  meId,
4573
5217
  showReadState,
4574
5218
  receiptsVisible,
@@ -4585,10 +5229,26 @@ function ConversationView({
4585
5229
  showAvatars,
4586
5230
  maxBodyLength,
4587
5231
  sequenceByMessageId,
4588
- groupPositionById,
4589
- markdown
5232
+ markdown,
5233
+ layoutProps
4590
5234
  ]
4591
5235
  );
5236
+ const renderItem = useCallback(
5237
+ (msg) => {
5238
+ const groupPosition = groupPositionById.get(msg.id) ?? "standalone";
5239
+ if (renderMessage) {
5240
+ const custom = renderMessage(msg, meId, {
5241
+ layout,
5242
+ groupPosition,
5243
+ isRunStart: layout === "compact" || groupPosition === "first" || groupPosition === "standalone",
5244
+ renderDefault: () => defaultRow(msg, groupPosition)
5245
+ });
5246
+ if (custom !== null && custom !== void 0) return custom;
5247
+ }
5248
+ return defaultRow(msg, groupPosition);
5249
+ },
5250
+ [renderMessage, meId, layout, groupPositionById, defaultRow]
5251
+ );
4592
5252
  const editingMessage = useMemo(
4593
5253
  () => editingId ? messages.find((m) => m.id === editingId) ?? null : null,
4594
5254
  [editingId, messages]
@@ -4597,19 +5257,19 @@ function ConversationView({
4597
5257
  const out = [];
4598
5258
  let prev = null;
4599
5259
  for (const msg of visibleMessages) {
4600
- if (prev === null || !sameDay(msg.inserted_at, prev.inserted_at)) {
5260
+ if (daySeparators && (prev === null || !sameDay(msg.inserted_at, prev.inserted_at))) {
4601
5261
  const label = formatDayLabel(msg.inserted_at);
4602
5262
  out.push({
4603
5263
  kind: "separator",
4604
5264
  id: `sep-${msg.id}`,
4605
- node: /* @__PURE__ */ jsx(DaySeparator, { label })
5265
+ node: /* @__PURE__ */ jsx(DaySeparator, { label, variant: layout === "bubbles" ? "pill" : "rule" })
4606
5266
  });
4607
5267
  }
4608
5268
  out.push({ kind: "msg", msg });
4609
5269
  prev = msg;
4610
5270
  }
4611
5271
  return out;
4612
- }, [visibleMessages]);
5272
+ }, [visibleMessages, daySeparators, layout]);
4613
5273
  const composerProps = useMemo(
4614
5274
  () => ({
4615
5275
  onSend: async (body, opts) => {
@@ -4659,7 +5319,7 @@ function ConversationView({
4659
5319
  return /* @__PURE__ */ jsx(UploadProvider, { children: /* @__PURE__ */ jsxs(
4660
5320
  KeyboardAvoidingView,
4661
5321
  {
4662
- style: [styles22.root, { backgroundColor: theme.colors.paper }],
5322
+ style: [styles23.root, { backgroundColor: theme.colors.background }],
4663
5323
  behavior: Platform.OS === "ios" ? "padding" : "height",
4664
5324
  keyboardVerticalOffset: keyboardOffset,
4665
5325
  children: [
@@ -4668,8 +5328,8 @@ function ConversationView({
4668
5328
  Text,
4669
5329
  {
4670
5330
  style: [
4671
- styles22.notice,
4672
- { color: theme.colors.ink2, backgroundColor: theme.colors.surface2 }
5331
+ styles23.notice,
5332
+ { color: theme.colors.textMuted, backgroundColor: theme.colors.surfaceAlt }
4673
5333
  ],
4674
5334
  accessibilityRole: "alert",
4675
5335
  children: "That message isn't available."
@@ -4684,7 +5344,7 @@ function ConversationView({
4684
5344
  onJoin: onJoinCall
4685
5345
  }
4686
5346
  ) : null,
4687
- /* @__PURE__ */ jsxs(View, { style: styles22.listWrap, children: [
5347
+ /* @__PURE__ */ jsxs(View, { style: styles23.listWrap, children: [
4688
5348
  /* @__PURE__ */ jsx(
4689
5349
  MessageList,
4690
5350
  {
@@ -4702,7 +5362,7 @@ function ConversationView({
4702
5362
  (stream) => stream.status === "failed" ? /* @__PURE__ */ jsx(
4703
5363
  Text,
4704
5364
  {
4705
- style: [styles22.streamFailed, { color: theme.colors.ink3 }],
5365
+ style: [styles23.streamFailed, { color: theme.colors.textSubtle }],
4706
5366
  accessibilityRole: "alert",
4707
5367
  children: stream.error ? `The agent couldn't reply: ${stream.error}` : "The agent couldn't reply."
4708
5368
  },
@@ -4721,7 +5381,8 @@ function ConversationView({
4721
5381
  ...avatarFor ? { avatarFor } : {},
4722
5382
  showSenderName: showSenderLabels,
4723
5383
  showAvatar: showAvatars,
4724
- markdown
5384
+ markdown,
5385
+ ...layoutProps
4725
5386
  },
4726
5387
  stream.id
4727
5388
  )
@@ -4734,7 +5395,7 @@ function ConversationView({
4734
5395
  editingId ? /* @__PURE__ */ jsx(
4735
5396
  Pressable,
4736
5397
  {
4737
- style: styles22.editBackdrop,
5398
+ style: [styles23.editBackdrop, { backgroundColor: theme.colors.overlay }],
4738
5399
  onPress: () => setEditingId(null),
4739
5400
  accessibilityLabel: "Cancel editing"
4740
5401
  }
@@ -4749,7 +5410,9 @@ function ConversationView({
4749
5410
  onClose: () => setThreadRoot(null),
4750
5411
  conversationId,
4751
5412
  rootMessage: threadRoot,
4752
- ...labelFor ? { labelFor } : {}
5413
+ ...labelFor ? { labelFor } : {},
5414
+ layout,
5415
+ ...timeFormat ? { timeFormat } : {}
4753
5416
  }
4754
5417
  ) : null
4755
5418
  ]
@@ -4780,7 +5443,7 @@ function readStateForMessage(msg, members, meId, sequenceByMessageId) {
4780
5443
  });
4781
5444
  return anyRead ? "read" : "sent";
4782
5445
  }
4783
- var styles22 = StyleSheet.create({
5446
+ var styles23 = StyleSheet.create({
4784
5447
  root: {
4785
5448
  flex: 1
4786
5449
  },
@@ -4800,7 +5463,6 @@ var styles22 = StyleSheet.create({
4800
5463
  },
4801
5464
  editBackdrop: {
4802
5465
  ...StyleSheet.absoluteFillObject,
4803
- backgroundColor: "rgba(0,0,0,0.45)",
4804
5466
  // Sit above message rows by default but below any row that
4805
5467
  // explicitly elevates itself (MessageRow bumps zIndex/elevation
4806
5468
  // when isEditing is true).
@@ -4839,7 +5501,7 @@ function UserPickerSheet({
4839
5501
  title,
4840
5502
  searchable
4841
5503
  }) {
4842
- const theme = usePoolseTheme();
5504
+ const theme = useTheme();
4843
5505
  const [query, setQuery] = useState("");
4844
5506
  const [selectedIds, setSelectedIds] = useState([]);
4845
5507
  const [groupName, setGroupName] = useState("");
@@ -4902,17 +5564,17 @@ function UserPickerSheet({
4902
5564
  children: /* @__PURE__ */ jsxs(
4903
5565
  View,
4904
5566
  {
4905
- style: styles23.modalRoot,
5567
+ style: styles24.modalRoot,
4906
5568
  onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
4907
5569
  children: [
4908
- /* @__PURE__ */ jsx(Pressable, { style: styles23.backdrop, onPress: handleClose }),
5570
+ /* @__PURE__ */ jsx(Pressable, { style: styles24.backdrop, onPress: handleClose }),
4909
5571
  /* @__PURE__ */ jsx(
4910
5572
  Animated.View,
4911
5573
  {
4912
5574
  style: [
4913
- styles23.sheet,
5575
+ styles24.sheet,
4914
5576
  {
4915
- backgroundColor: theme.colors.paper,
5577
+ backgroundColor: theme.colors.background,
4916
5578
  borderTopLeftRadius: theme.radii.xl,
4917
5579
  borderTopRightRadius: theme.radii.xl,
4918
5580
  height: sheetHeight,
@@ -4928,28 +5590,28 @@ function UserPickerSheet({
4928
5590
  children: /* @__PURE__ */ jsxs(
4929
5591
  KeyboardAvoidingView,
4930
5592
  {
4931
- style: styles23.kav,
5593
+ style: styles24.kav,
4932
5594
  behavior: "padding",
4933
5595
  keyboardVerticalOffset: screenHeight - sheetHeight,
4934
5596
  children: [
4935
- /* @__PURE__ */ jsx(View, { ...panHandlers, style: styles23.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles23.dragPill, { backgroundColor: theme.colors.ink3 }] }) }),
4936
- /* @__PURE__ */ jsxs(View, { style: styles23.header, children: [
5597
+ /* @__PURE__ */ jsx(View, { ...panHandlers, style: styles24.dragHandle, children: /* @__PURE__ */ jsx(View, { style: [styles24.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
5598
+ /* @__PURE__ */ jsxs(View, { style: styles24.header, children: [
4937
5599
  /* @__PURE__ */ jsx(
4938
5600
  Pressable,
4939
5601
  {
4940
5602
  onPress: handleClose,
4941
5603
  hitSlop: 16,
4942
- style: [styles23.closeBtn, { backgroundColor: theme.colors.surface2 }],
5604
+ style: [styles24.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
4943
5605
  accessibilityLabel: "Close picker",
4944
- children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.ink })
5606
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
4945
5607
  }
4946
5608
  ),
4947
5609
  /* @__PURE__ */ jsx(
4948
5610
  Text,
4949
5611
  {
4950
5612
  style: [
4951
- styles23.title,
4952
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
5613
+ styles24.title,
5614
+ { color: theme.colors.text, fontFamily: theme.fonts.display }
4953
5615
  ],
4954
5616
  numberOfLines: 1,
4955
5617
  children: heading
@@ -4962,9 +5624,9 @@ function UserPickerSheet({
4962
5624
  disabled: !canCreate,
4963
5625
  hitSlop: 6,
4964
5626
  style: [
4965
- styles23.createBtn,
5627
+ styles24.createBtn,
4966
5628
  {
4967
- backgroundColor: canCreate ? theme.colors.brand : theme.colors.surface2,
5629
+ backgroundColor: canCreate ? theme.colors.accent : theme.colors.surfaceAlt,
4968
5630
  opacity: canCreate ? 1 : 0.6
4969
5631
  }
4970
5632
  ],
@@ -4972,7 +5634,7 @@ function UserPickerSheet({
4972
5634
  Text,
4973
5635
  {
4974
5636
  style: {
4975
- color: canCreate ? theme.colors.onBrand : theme.colors.ink3,
5637
+ color: canCreate ? theme.colors.accentText : theme.colors.textSubtle,
4976
5638
  fontWeight: "700",
4977
5639
  fontSize: 13
4978
5640
  },
@@ -4989,17 +5651,17 @@ function UserPickerSheet({
4989
5651
  TextInput,
4990
5652
  {
4991
5653
  placeholder: "Group name",
4992
- placeholderTextColor: theme.colors.ink3,
5654
+ placeholderTextColor: theme.colors.textSubtle,
4993
5655
  value: groupName,
4994
5656
  onChangeText: setGroupName,
4995
5657
  style: [
4996
- styles23.groupNameInput,
5658
+ styles24.groupNameInput,
4997
5659
  {
4998
- color: theme.colors.ink,
4999
- backgroundColor: theme.colors.surface2,
5660
+ color: theme.colors.text,
5661
+ backgroundColor: theme.colors.surfaceAlt,
5000
5662
  borderRadius: theme.radii.md,
5001
- fontFamily: theme.type.fontBody,
5002
- fontSize: theme.type.bodySize
5663
+ fontFamily: theme.fonts.body,
5664
+ fontSize: theme.fonts.sizeMd
5003
5665
  }
5004
5666
  ]
5005
5667
  }
@@ -5008,16 +5670,16 @@ function UserPickerSheet({
5008
5670
  TextInput,
5009
5671
  {
5010
5672
  placeholder: "Search\u2026",
5011
- placeholderTextColor: theme.colors.ink3,
5673
+ placeholderTextColor: theme.colors.textSubtle,
5012
5674
  value: query,
5013
5675
  onChangeText: setQuery,
5014
5676
  style: [
5015
- styles23.searchInput,
5677
+ styles24.searchInput,
5016
5678
  {
5017
- color: theme.colors.ink,
5018
- backgroundColor: theme.colors.surface2,
5679
+ color: theme.colors.text,
5680
+ backgroundColor: theme.colors.surfaceAlt,
5019
5681
  borderRadius: theme.radii.md,
5020
- fontFamily: theme.type.fontBody,
5682
+ fontFamily: theme.fonts.body,
5021
5683
  fontSize: 14
5022
5684
  }
5023
5685
  ]
@@ -5029,7 +5691,7 @@ function UserPickerSheet({
5029
5691
  data: filtered,
5030
5692
  keyExtractor: (u) => u.externalId,
5031
5693
  keyboardShouldPersistTaps: "handled",
5032
- ListEmptyComponent: /* @__PURE__ */ jsx(View, { style: styles23.empty, children: /* @__PURE__ */ jsx(Text, { style: [styles23.emptyText, { color: theme.colors.ink3 }], children: query ? "No matches." : "No users to show." }) }),
5694
+ ListEmptyComponent: /* @__PURE__ */ jsx(View, { style: styles24.empty, children: /* @__PURE__ */ jsx(Text, { style: [styles24.emptyText, { color: theme.colors.textSubtle }], children: query ? "No matches." : "No users to show." }) }),
5033
5695
  renderItem: ({ item }) => /* @__PURE__ */ jsx(
5034
5696
  UserRow,
5035
5697
  {
@@ -5065,48 +5727,48 @@ function UserRow({
5065
5727
  isGroup,
5066
5728
  onPress
5067
5729
  }) {
5068
- const theme = usePoolseTheme();
5730
+ const theme = useTheme();
5069
5731
  return /* @__PURE__ */ jsxs(
5070
5732
  Pressable,
5071
5733
  {
5072
5734
  onPress,
5073
5735
  style: [
5074
- styles23.row,
5736
+ styles24.row,
5075
5737
  {
5076
- backgroundColor: selected ? theme.colors.brandSoft : "transparent"
5738
+ backgroundColor: selected ? theme.colors.accentSoft : "transparent"
5077
5739
  }
5078
5740
  ],
5079
5741
  children: [
5080
- user.avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: user.avatarUrl }, style: styles23.avatarImg }) : /* @__PURE__ */ jsx(Avatar, { src: null, name: user.name, seed: user.externalId, size: "md" }),
5081
- /* @__PURE__ */ jsxs(View, { style: styles23.body, children: [
5742
+ user.avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: user.avatarUrl }, style: styles24.avatarImg }) : /* @__PURE__ */ jsx(Avatar, { src: null, name: user.name, seed: user.externalId, size: "md" }),
5743
+ /* @__PURE__ */ jsxs(View, { style: styles24.body, children: [
5082
5744
  /* @__PURE__ */ jsx(
5083
5745
  Text,
5084
5746
  {
5085
- style: [styles23.name, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
5747
+ style: [styles24.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
5086
5748
  numberOfLines: 1,
5087
5749
  children: user.name
5088
5750
  }
5089
5751
  ),
5090
- user.subtitle ? /* @__PURE__ */ jsx(Text, { style: [styles23.subtitle, { color: theme.colors.ink3 }], numberOfLines: 1, children: user.subtitle }) : null
5752
+ user.subtitle ? /* @__PURE__ */ jsx(Text, { style: [styles24.subtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: user.subtitle }) : null
5091
5753
  ] }),
5092
5754
  isGroup ? /* @__PURE__ */ jsx(
5093
5755
  View,
5094
5756
  {
5095
5757
  style: [
5096
- styles23.checkbox,
5758
+ styles24.checkbox,
5097
5759
  {
5098
- borderColor: selected ? theme.colors.brand : theme.colors.border,
5099
- backgroundColor: selected ? theme.colors.brand : "transparent"
5760
+ borderColor: selected ? theme.colors.accent : theme.colors.border,
5761
+ backgroundColor: selected ? theme.colors.accent : "transparent"
5100
5762
  }
5101
5763
  ],
5102
- children: selected ? /* @__PURE__ */ jsx(PoolseIcon, { name: "check", size: 14, color: theme.colors.onBrand }) : null
5764
+ children: selected ? /* @__PURE__ */ jsx(PoolseIcon, { name: "check", size: 14, color: theme.colors.accentText }) : null
5103
5765
  }
5104
5766
  ) : null
5105
5767
  ]
5106
5768
  }
5107
5769
  );
5108
5770
  }
5109
- var styles23 = StyleSheet.create({
5771
+ var styles24 = StyleSheet.create({
5110
5772
  modalRoot: {
5111
5773
  flex: 1,
5112
5774
  justifyContent: "flex-end"
@@ -5222,7 +5884,7 @@ var PoolseInbox = forwardRef(
5222
5884
  emptyState,
5223
5885
  keyboardOffset = 0
5224
5886
  } = props;
5225
- const theme = usePoolseTheme();
5887
+ const theme = useTheme();
5226
5888
  const { width: screenWidth } = useWindowDimensions();
5227
5889
  const { me } = useMe();
5228
5890
  const {
@@ -5370,7 +6032,7 @@ var PoolseInbox = forwardRef(
5370
6032
  },
5371
6033
  [renderConversationRow, meExternalId, meId, labelFor, avatarFor, unreadCounts]
5372
6034
  );
5373
- return /* @__PURE__ */ jsxs(View, { style: [styles24.root, { backgroundColor: theme.colors.paper }], children: [
6035
+ return /* @__PURE__ */ jsxs(View, { style: [styles25.root, { backgroundColor: theme.colors.background }], children: [
5374
6036
  /* @__PURE__ */ jsxs(
5375
6037
  Animated.View,
5376
6038
  {
@@ -5381,7 +6043,7 @@ var PoolseInbox = forwardRef(
5381
6043
  View,
5382
6044
  {
5383
6045
  style: [
5384
- styles24.listHeader,
6046
+ styles25.listHeader,
5385
6047
  {
5386
6048
  backgroundColor: theme.colors.surface,
5387
6049
  borderBottomColor: theme.colors.border
@@ -5392,13 +6054,13 @@ var PoolseInbox = forwardRef(
5392
6054
  Text,
5393
6055
  {
5394
6056
  style: [
5395
- styles24.listTitle,
5396
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
6057
+ styles25.listTitle,
6058
+ { color: theme.colors.text, fontFamily: theme.fonts.display }
5397
6059
  ],
5398
6060
  children: title
5399
6061
  }
5400
6062
  ),
5401
- /* @__PURE__ */ jsxs(View, { style: styles24.headerActions, children: [
6063
+ /* @__PURE__ */ jsxs(View, { style: styles25.headerActions, children: [
5402
6064
  users ? /* @__PURE__ */ jsxs(Fragment, { children: [
5403
6065
  /* @__PURE__ */ jsx(
5404
6066
  HeaderIconButton,
@@ -5503,7 +6165,7 @@ function HeaderIconButton({
5503
6165
  onPress,
5504
6166
  label
5505
6167
  }) {
5506
- const theme = usePoolseTheme();
6168
+ const theme = useTheme();
5507
6169
  return /* @__PURE__ */ jsx(
5508
6170
  Pressable,
5509
6171
  {
@@ -5511,12 +6173,12 @@ function HeaderIconButton({
5511
6173
  hitSlop: 10,
5512
6174
  accessibilityLabel: label,
5513
6175
  style: ({ pressed }) => [
5514
- styles24.iconBtn,
6176
+ styles25.iconBtn,
5515
6177
  {
5516
- backgroundColor: pressed ? theme.colors.surface2 : "transparent"
6178
+ backgroundColor: pressed ? theme.colors.surfaceAlt : "transparent"
5517
6179
  }
5518
6180
  ],
5519
- children: /* @__PURE__ */ jsx(PoolseIcon, { name: icon, size: 20, color: theme.colors.ink })
6181
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: icon, size: 20, color: theme.colors.text })
5520
6182
  }
5521
6183
  );
5522
6184
  }
@@ -5530,7 +6192,7 @@ function DefaultConversationRow({
5530
6192
  avatarFor,
5531
6193
  onPress
5532
6194
  }) {
5533
- const theme = usePoolseTheme();
6195
+ const theme = useTheme();
5534
6196
  const isDirect = conv.type === "direct";
5535
6197
  const otherExtId = isDirect && meExternalId ? (conv.member_external_ids ?? []).find((x) => x !== meExternalId) : null;
5536
6198
  const resolvedOther = useUser(isDirect ? otherExtId ?? null : null);
@@ -5542,31 +6204,31 @@ function DefaultConversationRow({
5542
6204
  {
5543
6205
  onPress,
5544
6206
  style: [
5545
- styles24.row,
6207
+ styles25.row,
5546
6208
  {
5547
- backgroundColor: selected ? theme.colors.surface2 : "transparent",
6209
+ backgroundColor: selected ? theme.colors.surfaceAlt : "transparent",
5548
6210
  borderBottomColor: theme.colors.border
5549
6211
  }
5550
6212
  ],
5551
6213
  children: [
5552
- avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: avatarUrl }, style: styles24.rowAvatar }) : /* @__PURE__ */ jsx(Avatar, { src: null, name: title, seed: avatarSeed, size: "md" }),
5553
- /* @__PURE__ */ jsxs(View, { style: styles24.rowBody, children: [
6214
+ avatarUrl ? /* @__PURE__ */ jsx(Image, { source: { uri: avatarUrl }, style: styles25.rowAvatar }) : /* @__PURE__ */ jsx(Avatar, { src: null, name: title, seed: avatarSeed, size: "md" }),
6215
+ /* @__PURE__ */ jsxs(View, { style: styles25.rowBody, children: [
5554
6216
  /* @__PURE__ */ jsx(
5555
6217
  Text,
5556
6218
  {
5557
- style: [styles24.rowTitle, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
6219
+ style: [styles25.rowTitle, { color: theme.colors.text, fontFamily: theme.fonts.body }],
5558
6220
  numberOfLines: 1,
5559
6221
  children: title
5560
6222
  }
5561
6223
  ),
5562
- /* @__PURE__ */ jsx(Text, { style: [styles24.rowSubtitle, { color: theme.colors.ink3 }], numberOfLines: 1, children: formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview ?? (isDirect ? otherExtId ?? "" : `${(conv.member_external_ids ?? []).length} members`) })
6224
+ /* @__PURE__ */ jsx(Text, { style: [styles25.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`) })
5563
6225
  ] }),
5564
- unread > 0 ? /* @__PURE__ */ jsx(View, { style: [styles24.unreadPill, { backgroundColor: theme.colors.unreadPill }], children: /* @__PURE__ */ jsx(Text, { style: [styles24.unreadText, { color: theme.colors.unreadPillText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
6226
+ unread > 0 ? /* @__PURE__ */ jsx(View, { style: [styles25.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsx(Text, { style: [styles25.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
5565
6227
  ]
5566
6228
  }
5567
6229
  );
5568
6230
  }
5569
- var styles24 = StyleSheet.create({
6231
+ var styles25 = StyleSheet.create({
5570
6232
  root: {
5571
6233
  flex: 1,
5572
6234
  overflow: "hidden"
@@ -5647,16 +6309,16 @@ var VARIANT_VB = {
5647
6309
  mono: { vb: [0, 0, 454, 100], aspect: 4.54 }
5648
6310
  };
5649
6311
  function PoolseLogo({ variant = "lockup", size = 28, color, label }) {
5650
- const theme = usePoolseTheme();
6312
+ const theme = useTheme();
5651
6313
  const mono = variant === "mono";
5652
- const monoColor = color ?? theme.colors.ink;
5653
- const tileFill = mono ? "none" : theme.colors.brand;
6314
+ const monoColor = color ?? theme.colors.text;
6315
+ const tileFill = mono ? "none" : theme.colors.accent;
5654
6316
  const tileStroke = mono ? monoColor : "transparent";
5655
6317
  const tileStrokeWidth = mono ? 5 : 0;
5656
- const pulseStroke = mono ? monoColor : theme.colors.onBrand;
5657
- const pulseDotFill = mono ? monoColor : theme.colors.onBrand;
5658
- const inkFill = mono ? monoColor : theme.colors.ink;
5659
- const oFill = mono ? monoColor : theme.colors.brand;
6318
+ const pulseStroke = mono ? monoColor : theme.colors.accentText;
6319
+ const pulseDotFill = mono ? monoColor : theme.colors.accentText;
6320
+ const inkFill = mono ? monoColor : theme.colors.text;
6321
+ const oFill = mono ? monoColor : theme.colors.accent;
5660
6322
  const { vb, aspect } = VARIANT_VB[variant];
5661
6323
  const width = size * aspect;
5662
6324
  const showMark = variant === "lockup" || variant === "mark" || variant === "mono";
@@ -5751,7 +6413,7 @@ function CallControlButton({
5751
6413
  const size = large ? CONTROL_SIZE_LARGE : CONTROL_SIZE;
5752
6414
  const background = tone === "danger" ? callColors.danger : tone === "accept" ? callColors.accept : active ? callColors.controlActive : callColors.control;
5753
6415
  const iconColor = tone === "neutral" && active ? callColors.controlActiveIcon : callColors.onAction;
5754
- return /* @__PURE__ */ jsxs(View, { style: styles25.slot, children: [
6416
+ return /* @__PURE__ */ jsxs(View, { style: styles26.slot, children: [
5755
6417
  /* @__PURE__ */ jsx(
5756
6418
  Pressable,
5757
6419
  {
@@ -5762,7 +6424,7 @@ function CallControlButton({
5762
6424
  accessibilityLabel: accessibilityLabel ?? label ?? icon,
5763
6425
  hitSlop: 8,
5764
6426
  style: ({ pressed }) => [
5765
- styles25.button,
6427
+ styles26.button,
5766
6428
  {
5767
6429
  width: size,
5768
6430
  height: size,
@@ -5776,10 +6438,10 @@ function CallControlButton({
5776
6438
  children: /* @__PURE__ */ jsx(PoolseIcon, { name: icon, size: large ? 30 : 25, color: iconColor, label: null })
5777
6439
  }
5778
6440
  ),
5779
- label ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles25.label, children: label }) : null
6441
+ label ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles26.label, children: label }) : null
5780
6442
  ] });
5781
6443
  }
5782
- var styles25 = StyleSheet.create({
6444
+ var styles26 = StyleSheet.create({
5783
6445
  // Fixed width so captions of different lengths cannot shift the row.
5784
6446
  slot: { width: 76, alignItems: "center", gap: 7 },
5785
6447
  button: { alignItems: "center", justifyContent: "center" },
@@ -5792,7 +6454,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
5792
6454
  View,
5793
6455
  {
5794
6456
  style: [
5795
- styles26.ring,
6457
+ styles27.ring,
5796
6458
  {
5797
6459
  width: outer,
5798
6460
  height: outer,
@@ -5805,7 +6467,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
5805
6467
  View,
5806
6468
  {
5807
6469
  style: [
5808
- styles26.circle,
6470
+ styles27.circle,
5809
6471
  {
5810
6472
  width: size,
5811
6473
  height: size,
@@ -5816,7 +6478,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
5816
6478
  children: /* @__PURE__ */ jsx(
5817
6479
  Text,
5818
6480
  {
5819
- style: [styles26.initials, { fontSize: Math.round(size * 0.38) }],
6481
+ style: [styles27.initials, { fontSize: Math.round(size * 0.38) }],
5820
6482
  numberOfLines: 1,
5821
6483
  allowFontScaling: false,
5822
6484
  children: initialsOf(name)
@@ -5833,7 +6495,7 @@ function initialsOf(name) {
5833
6495
  if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
5834
6496
  return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
5835
6497
  }
5836
- var styles26 = StyleSheet.create({
6498
+ var styles27 = StyleSheet.create({
5837
6499
  ring: { alignItems: "center", justifyContent: "center" },
5838
6500
  circle: { alignItems: "center", justifyContent: "center" },
5839
6501
  initials: { color: "#ffffff", fontWeight: "600" }
@@ -5861,15 +6523,15 @@ function AudioRouteSheet({
5861
6523
  animationType: "fade",
5862
6524
  onRequestClose: onClose,
5863
6525
  ...EDGE_TO_EDGE_MODAL,
5864
- children: /* @__PURE__ */ jsx(Pressable, { style: styles27.backdrop, onPress: onClose, accessibilityRole: "button", children: /* @__PURE__ */ jsxs(
6526
+ children: /* @__PURE__ */ jsx(Pressable, { style: styles28.backdrop, onPress: onClose, accessibilityRole: "button", children: /* @__PURE__ */ jsxs(
5865
6527
  Pressable,
5866
6528
  {
5867
- style: [styles27.sheet, { paddingBottom: Math.max(34, insets.bottom + 16) }],
6529
+ style: [styles28.sheet, { paddingBottom: Math.max(34, insets.bottom + 16) }],
5868
6530
  onPress: () => {
5869
6531
  },
5870
6532
  children: [
5871
- /* @__PURE__ */ jsx(View, { style: styles27.grabber }),
5872
- /* @__PURE__ */ jsx(Text, { style: styles27.title, children: "Audio output" }),
6533
+ /* @__PURE__ */ jsx(View, { style: styles28.grabber }),
6534
+ /* @__PURE__ */ jsx(Text, { style: styles28.title, children: "Audio output" }),
5873
6535
  routes.map((route) => {
5874
6536
  const selected = route.id === selectedRouteId;
5875
6537
  return /* @__PURE__ */ jsxs(
@@ -5881,7 +6543,7 @@ function AudioRouteSheet({
5881
6543
  },
5882
6544
  accessibilityRole: "button",
5883
6545
  accessibilityState: { selected },
5884
- style: ({ pressed }) => [styles27.row, pressed && styles27.rowPressed],
6546
+ style: ({ pressed }) => [styles28.row, pressed && styles28.rowPressed],
5885
6547
  children: [
5886
6548
  /* @__PURE__ */ jsx(
5887
6549
  PoolseIcon,
@@ -5892,7 +6554,7 @@ function AudioRouteSheet({
5892
6554
  label: null
5893
6555
  }
5894
6556
  ),
5895
- /* @__PURE__ */ jsx(Text, { style: [styles27.label, selected && styles27.labelSelected], children: route.label }),
6557
+ /* @__PURE__ */ jsx(Text, { style: [styles28.label, selected && styles28.labelSelected], children: route.label }),
5896
6558
  selected && /* @__PURE__ */ jsx(PoolseIcon, { name: "check", size: 19, color: callColors.accept, label: "selected" })
5897
6559
  ]
5898
6560
  },
@@ -5905,7 +6567,7 @@ function AudioRouteSheet({
5905
6567
  }
5906
6568
  );
5907
6569
  }
5908
- var styles27 = StyleSheet.create({
6570
+ var styles28 = StyleSheet.create({
5909
6571
  backdrop: { flex: 1, backgroundColor: "rgba(0,0,0,0.55)", justifyContent: "flex-end" },
5910
6572
  sheet: {
5911
6573
  backgroundColor: callColors.tile,
@@ -5965,6 +6627,6 @@ function format(total) {
5965
6627
  return `${hours > 0 ? `${hours}:` : ""}${mm}:${String(seconds).padStart(2, "0")}`;
5966
6628
  }
5967
6629
 
5968
- export { AttachmentPicker, AttachmentPreview, AudioRouteSheet, Avatar, CallAvatar, CallControlButton, CallLogRow, ChatHeader, ConversationList, ConversationView, DaySeparator, GroupDetailsSheet, ImageMosaic, LiveCallBanner, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, MessageList, MessageRow, PoolseIcon, PoolseInbox, PoolseLogo, PoolseTheme, primitives as Primitives, ReactionPicker, ReactionStrip, ThreadView, TypingIndicator, UploadQueueStrip, UserName, callColors, defaultDarkTheme, defaultLightTheme, useAppStateLifecycle, useCallDuration, useDisplayName, usePoolseTheme };
6630
+ export { AttachmentPicker, AttachmentPreview, AudioRouteSheet, Avatar, CallAvatar, CallControlButton, CallLogRow, ChatHeader, ConversationList, ConversationView, DaySeparator, GroupDetailsSheet, ImageMosaic, LiveCallBanner, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, MessageList, MessageRow, PoolseIcon, PoolseInbox, PoolseLogo, PoolseTheme, primitives as Primitives, ReactionPicker, ReactionStrip, ThreadView, TypingIndicator, UploadQueueStrip, UserName, callColors, defaultDarkTheme, defaultLightTheme, useAppStateLifecycle, useCallDuration, useDisplayName, useTheme };
5969
6631
  //# sourceMappingURL=index.js.map
5970
6632
  //# sourceMappingURL=index.js.map