@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.cjs CHANGED
@@ -3,6 +3,7 @@
3
3
  var react$1 = require('@poolse/react');
4
4
  var react = require('react');
5
5
  var reactNative = require('react-native');
6
+ var theme = require('@poolse/theme');
6
7
  var jsxRuntime = require('react/jsx-runtime');
7
8
  var reactNativeSvg = require('react-native-svg');
8
9
  var reactNativeSafeAreaContext = require('react-native-safe-area-context');
@@ -179,28 +180,172 @@ var defaultDarkTheme = {
179
180
  spacing,
180
181
  shadows: darkShadows
181
182
  };
182
- var ThemeContext = react.createContext(null);
183
- function PoolseTheme({ mode, theme, children }) {
184
- const resolved = react.useMemo(() => {
185
- const base = (mode ?? theme?.mode) === "dark" ? defaultDarkTheme : defaultLightTheme;
186
- if (!theme) return base;
187
- return {
188
- mode: theme.mode ?? base.mode,
189
- colors: { ...base.colors, ...theme.colors },
190
- type: { ...base.type, ...theme.type },
191
- radii: { ...base.radii, ...theme.radii },
192
- spacing: { ...base.spacing, ...theme.spacing },
193
- shadows: {
194
- sm: { ...base.shadows.sm, ...theme.shadows?.sm },
195
- md: { ...base.shadows.md, ...theme.shadows?.md },
196
- lg: { ...base.shadows.lg, ...theme.shadows?.lg }
183
+ function legacyToNative(l) {
184
+ const c = l.colors;
185
+ return {
186
+ id: "default",
187
+ name: "Default",
188
+ scheme: l.mode,
189
+ colors: {
190
+ background: c.paper,
191
+ surface: c.surface,
192
+ surfaceAlt: c.surface2,
193
+ text: c.ink,
194
+ textMuted: c.ink2,
195
+ textSubtle: c.ink3,
196
+ border: c.border,
197
+ accent: c.brand,
198
+ accentText: c.onBrand,
199
+ accentSoft: c.brandSoft,
200
+ accentStrong: c.brandStrong,
201
+ // Links in other people's bubbles have always been brand-coloured.
202
+ link: c.brand,
203
+ sidebar: c.surface2,
204
+ sidebarText: c.ink,
205
+ sidebarActive: c.brandSoft,
206
+ sidebarActiveText: c.brandStrong,
207
+ badge: c.unreadPill,
208
+ badgeText: c.unreadPillText,
209
+ mention: c.brandSoft,
210
+ mentionText: c.brandStrong,
211
+ danger: c.error,
212
+ warning: c.warning,
213
+ success: c.success,
214
+ info: c.info,
215
+ presence: c.presence,
216
+ ownBubble: c.selfBubble,
217
+ ownBubbleText: c.selfBubbleText,
218
+ otherBubble: c.otherBubble,
219
+ otherBubbleText: c.otherBubbleText,
220
+ overlay: "#00000073"
221
+ },
222
+ fonts: {
223
+ body: l.type.fontBody,
224
+ display: l.type.fontDisplay,
225
+ mono: l.type.fontMono,
226
+ sizeXs: 11,
227
+ sizeSm: 13,
228
+ sizeMd: l.type.bodySize,
229
+ sizeLg: 17,
230
+ sizeXl: 20,
231
+ lineHeight: l.type.lineHeight
232
+ },
233
+ radii: { ...l.radii },
234
+ spacing: { ...l.spacing },
235
+ shadows: { sm: l.shadows.sm, md: l.shadows.md, lg: l.shadows.lg }
236
+ };
237
+ }
238
+ function nativeToLegacy(n) {
239
+ const c = n.colors;
240
+ return {
241
+ mode: n.scheme,
242
+ colors: {
243
+ brand: c.accent,
244
+ brandStrong: c.accentStrong,
245
+ brandSoft: c.accentSoft,
246
+ onBrand: c.accentText,
247
+ paper: c.background,
248
+ surface: c.surface,
249
+ surface2: c.surfaceAlt,
250
+ ink: c.text,
251
+ ink2: c.textMuted,
252
+ ink3: c.textSubtle,
253
+ border: c.border,
254
+ presence: c.presence,
255
+ success: c.success,
256
+ warning: c.warning,
257
+ error: c.danger,
258
+ info: c.info,
259
+ selfBubble: c.ownBubble,
260
+ selfBubbleText: c.ownBubbleText,
261
+ otherBubble: c.otherBubble,
262
+ otherBubbleText: c.otherBubbleText,
263
+ unreadPill: c.badge,
264
+ unreadPillText: c.badgeText
265
+ },
266
+ type: {
267
+ ...type,
268
+ fontDisplay: n.fonts.display,
269
+ fontBody: n.fonts.body,
270
+ fontMono: n.fonts.mono,
271
+ bodySize: n.fonts.sizeMd,
272
+ lineHeight: n.fonts.lineHeight
273
+ },
274
+ radii: { ...n.radii },
275
+ spacing: { ...n.spacing },
276
+ shadows: { ...n.shadows }
277
+ };
278
+ }
279
+ function isTheme(value) {
280
+ return typeof value === "object" && value !== null && "light" in value && "dark" in value && "id" in value;
281
+ }
282
+ function mergeLegacy(base, theme) {
283
+ return {
284
+ mode: theme.mode ?? base.mode,
285
+ colors: { ...base.colors, ...theme.colors },
286
+ type: { ...base.type, ...theme.type },
287
+ radii: { ...base.radii, ...theme.radii },
288
+ spacing: { ...base.spacing, ...theme.spacing },
289
+ shadows: {
290
+ sm: { ...base.shadows.sm, ...theme.shadows?.sm },
291
+ md: { ...base.shadows.md, ...theme.shadows?.md },
292
+ lg: { ...base.shadows.lg, ...theme.shadows?.lg }
293
+ }
294
+ };
295
+ }
296
+ function isNamedTheme(theme$1) {
297
+ return theme.isBuiltInThemeId(theme$1) || isTheme(theme$1);
298
+ }
299
+ function selectedScheme(selection, system) {
300
+ const { theme } = selection;
301
+ const named = isNamedTheme(theme);
302
+ const legacyMode = !named && theme ? theme.mode : void 0;
303
+ const preference = selection.colorScheme ?? selection.mode ?? legacyMode ?? (named ? "system" : "light");
304
+ return preference === "system" ? system : preference;
305
+ }
306
+ function resolveThemeValue(selection, scheme) {
307
+ const { theme: theme$1, fonts } = selection;
308
+ if (isNamedTheme(theme$1)) {
309
+ const native = theme.toNativeTheme(theme$1, scheme, {
310
+ fonts: {
311
+ ...fonts?.body ? { body: fonts.body } : {},
312
+ ...fonts?.display ? { display: fonts.display } : {},
313
+ ...fonts?.mono ? { mono: fonts.mono } : {}
197
314
  }
198
- };
199
- }, [mode, theme]);
200
- return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: resolved, children });
315
+ });
316
+ return { native, legacy: nativeToLegacy(native) };
317
+ }
318
+ const base = scheme === "dark" ? defaultDarkTheme : defaultLightTheme;
319
+ const legacy = theme$1 ? { ...mergeLegacy(base, theme$1), mode: scheme } : base;
320
+ return { native: legacyToNative(legacy), legacy };
321
+ }
322
+ var ThemeContext = react.createContext(null);
323
+ var FALLBACK = {
324
+ native: legacyToNative(defaultLightTheme)};
325
+ function PoolseTheme({ theme, colorScheme, mode, fonts, children }) {
326
+ const system = reactNative.useColorScheme() === "dark" ? "dark" : "light";
327
+ const scheme = selectedScheme({ theme, colorScheme, mode }, system);
328
+ const fontBody = fonts?.body;
329
+ const fontDisplay = fonts?.display;
330
+ const fontMono = fonts?.mono;
331
+ const value = react.useMemo(
332
+ () => resolveThemeValue(
333
+ {
334
+ theme,
335
+ fonts: {
336
+ ...fontBody ? { body: fontBody } : {},
337
+ ...fontDisplay ? { display: fontDisplay } : {},
338
+ ...fontMono ? { mono: fontMono } : {}
339
+ }
340
+ },
341
+ scheme
342
+ ),
343
+ [theme, scheme, fontBody, fontDisplay, fontMono]
344
+ );
345
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value, children });
201
346
  }
202
- function usePoolseTheme() {
203
- return react.useContext(ThemeContext) ?? defaultLightTheme;
347
+ function useTheme() {
348
+ return (react.useContext(ThemeContext) ?? FALLBACK).native;
204
349
  }
205
350
 
206
351
  // src/primitives/userColor.ts
@@ -229,13 +374,13 @@ function userColor(id) {
229
374
  }
230
375
  return PALETTE[Math.abs(h) % PALETTE.length];
231
376
  }
232
- var SIZES = { sm: 28, md: 40, lg: 56 };
377
+ var SIZES = { xs: 20, sm: 28, md: 40, lg: 56 };
233
378
  function Avatar({ src, name, seed, online, size = "md" }) {
234
- const theme = usePoolseTheme();
379
+ const theme = useTheme();
235
380
  const dim = SIZES[size];
236
381
  const initials = computeInitials(name);
237
- const tint = seed ? userColor(seed) : theme.colors.brand;
238
- const fontSize = size === "sm" ? 11 : size === "lg" ? 22 : 15;
382
+ const tint = seed ? userColor(seed) : theme.colors.accent;
383
+ const fontSize = size === "xs" ? 9 : size === "sm" ? 11 : size === "lg" ? 22 : 15;
239
384
  return /* @__PURE__ */ jsxRuntime.jsxs(
240
385
  reactNative.View,
241
386
  {
@@ -262,10 +407,10 @@ function Avatar({ src, name, seed, online, size = "md" }) {
262
407
  reactNative.Text,
263
408
  {
264
409
  style: {
265
- color: theme.colors.onBrand,
410
+ color: theme.colors.accentText,
266
411
  fontSize,
267
412
  fontWeight: "600",
268
- fontFamily: theme.type.fontBody
413
+ fontFamily: theme.fonts.body
269
414
  },
270
415
  children: initials
271
416
  }
@@ -572,10 +717,10 @@ var ICONS = {
572
717
  }
573
718
  };
574
719
  function PoolseIcon({ name, size = 20, color, label }) {
575
- const theme = usePoolseTheme();
720
+ const theme = useTheme();
576
721
  const def = ICONS[name];
577
722
  if (!def) return null;
578
- const stroke = color ?? theme.colors.ink;
723
+ const stroke = color ?? theme.colors.text;
579
724
  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>`;
580
725
  const a11y = label === null ? { accessibilityRole: "none" } : { accessibilityRole: "image", accessibilityLabel: label ?? name };
581
726
  return /* @__PURE__ */ jsxRuntime.jsx(reactNativeSvg.SvgXml, { xml, width: size, height: size, ...a11y });
@@ -589,30 +734,30 @@ function MemberList({
589
734
  renderItem,
590
735
  emptyState
591
736
  }) {
592
- const theme = usePoolseTheme();
737
+ const theme = useTheme();
593
738
  const { members, loading, error, removeMember } = react$1.useMembers(conversationId);
594
739
  const { online: presenceOnline } = react$1.usePresence(
595
740
  onlineExternalIds === void 0 ? conversationId : ""
596
741
  );
597
742
  const effectiveOnline = onlineExternalIds ?? presenceOnline;
598
743
  if (loading && members.length === 0) {
599
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.placeholder, { backgroundColor: theme.colors.paper }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.brand }) });
744
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.accent }) });
600
745
  }
601
746
  if (error) {
602
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles2.placeholder, { backgroundColor: theme.colors.paper }], children: [
603
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.error, fontFamily: theme.type.fontBody }, children: "Failed to load members." }),
604
- error.message ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles2.errorDetail, { color: theme.colors.ink3 }], children: error.message }) : null
747
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles2.placeholder, { backgroundColor: theme.colors.background }], children: [
748
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.danger, fontFamily: theme.fonts.body }, children: "Failed to load members." }),
749
+ error.message ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles2.errorDetail, { color: theme.colors.textSubtle }], children: error.message }) : null
605
750
  ] });
606
751
  }
607
752
  if (members.length === 0) {
608
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.placeholder, { backgroundColor: theme.colors.paper }], children: typeof emptyState === "string" || emptyState == null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.ink3, fontFamily: theme.type.fontBody }, children: emptyState ?? "No members." }) : emptyState });
753
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.placeholder, { backgroundColor: theme.colors.background }], children: typeof emptyState === "string" || emptyState == null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState ?? "No members." }) : emptyState });
609
754
  }
610
755
  return /* @__PURE__ */ jsxRuntime.jsx(
611
756
  reactNative.FlatList,
612
757
  {
613
758
  data: members,
614
759
  keyExtractor: (m) => m.user_id,
615
- style: { backgroundColor: theme.colors.paper },
760
+ style: { backgroundColor: theme.colors.background },
616
761
  renderItem: ({ item }) => {
617
762
  if (renderItem) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderItem(item) });
618
763
  const isOnline = effectiveOnline.has(item.external_id);
@@ -640,7 +785,7 @@ function MemberRow({
640
785
  avatarFor,
641
786
  onRemove
642
787
  }) {
643
- const theme = usePoolseTheme();
788
+ const theme = useTheme();
644
789
  const resolved = react$1.useUser(externalId);
645
790
  const name = labelFor?.(externalId) ?? resolved.profile?.displayName ?? externalId;
646
791
  const avatarUrl = avatarFor?.(externalId) ?? resolved.profile?.avatarUrl ?? null;
@@ -650,14 +795,14 @@ function MemberRow({
650
795
  /* @__PURE__ */ jsxRuntime.jsx(
651
796
  reactNative.Text,
652
797
  {
653
- style: [styles2.name, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
798
+ style: [styles2.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
654
799
  numberOfLines: 1,
655
800
  children: name
656
801
  }
657
802
  ),
658
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles2.role, { color: theme.colors.ink3 }], children: role })
803
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles2.role, { color: theme.colors.textSubtle }], children: role })
659
804
  ] }),
660
- onRemove ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onRemove, hitSlop: 8, style: styles2.removeBtn, children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.ink2 }) }) : null
805
+ onRemove ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onRemove, hitSlop: 8, style: styles2.removeBtn, children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
661
806
  ] });
662
807
  }
663
808
  var styles2 = reactNative.StyleSheet.create({
@@ -752,7 +897,7 @@ function GroupDetailsSheet({
752
897
  avatarFor,
753
898
  canRemoveMember
754
899
  }) {
755
- const theme = usePoolseTheme();
900
+ const theme = useTheme();
756
901
  const { conversation } = react$1.useConversation(conversationId);
757
902
  const { members } = react$1.useMembers(conversationId);
758
903
  const insets = useSafeInsets();
@@ -786,7 +931,7 @@ function GroupDetailsSheet({
786
931
  style: [
787
932
  styles3.sheet,
788
933
  {
789
- backgroundColor: theme.colors.paper,
934
+ backgroundColor: theme.colors.background,
790
935
  borderTopLeftRadius: theme.radii.xl,
791
936
  borderTopRightRadius: theme.radii.xl,
792
937
  // Header stays below the status bar even on short screens.
@@ -799,16 +944,16 @@ function GroupDetailsSheet({
799
944
  theme.shadows.lg
800
945
  ],
801
946
  children: [
802
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...panHandlers, style: styles3.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles3.dragPill, { backgroundColor: theme.colors.ink3 }] }) }),
947
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...panHandlers, style: styles3.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles3.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
803
948
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles3.headerRow, children: [
804
949
  /* @__PURE__ */ jsxRuntime.jsx(
805
950
  reactNative.Pressable,
806
951
  {
807
952
  onPress: onClose,
808
953
  hitSlop: 16,
809
- style: [styles3.closeBtn, { backgroundColor: theme.colors.surface2 }],
954
+ style: [styles3.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
810
955
  accessibilityLabel: "Close",
811
- children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.ink })
956
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
812
957
  }
813
958
  ),
814
959
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -816,7 +961,7 @@ function GroupDetailsSheet({
816
961
  {
817
962
  style: [
818
963
  styles3.headerTitle,
819
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
964
+ { color: theme.colors.text, fontFamily: theme.fonts.display }
820
965
  ],
821
966
  children: "Group details"
822
967
  }
@@ -827,15 +972,12 @@ function GroupDetailsSheet({
827
972
  /* @__PURE__ */ jsxRuntime.jsx(
828
973
  reactNative.Text,
829
974
  {
830
- style: [
831
- styles3.title,
832
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
833
- ],
975
+ style: [styles3.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
834
976
  numberOfLines: 1,
835
977
  children: title
836
978
  }
837
979
  ),
838
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles3.subtitle, { color: theme.colors.ink3 }], children: subtitle })
980
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles3.subtitle, { color: theme.colors.textSubtle }], children: subtitle })
839
981
  ] }),
840
982
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles3.divider, { backgroundColor: theme.colors.border }] }),
841
983
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles3.sectionLabelRow, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -843,7 +985,7 @@ function GroupDetailsSheet({
843
985
  {
844
986
  style: [
845
987
  styles3.sectionLabel,
846
- { color: theme.colors.ink2, fontFamily: theme.type.fontBody }
988
+ { color: theme.colors.textMuted, fontFamily: theme.fonts.body }
847
989
  ],
848
990
  children: "Members"
849
991
  }
@@ -944,7 +1086,7 @@ function ChatHeader({
944
1086
  onPress,
945
1087
  onBack
946
1088
  }) {
947
- const theme = usePoolseTheme();
1089
+ const theme = useTheme();
948
1090
  const { conversation } = react$1.useConversation(conversationId);
949
1091
  const { members } = react$1.useMembers(conversationId);
950
1092
  const { me } = react$1.useMe();
@@ -991,18 +1133,18 @@ function ChatHeader({
991
1133
  }
992
1134
  ],
993
1135
  children: [
994
- onBack ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onBack, hitSlop: 12, style: styles4.backBtn, accessibilityLabel: "Back", children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "reply", size: 20, color: theme.colors.ink }) }) : null,
1136
+ onBack ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onBack, hitSlop: 12, style: styles4.backBtn, accessibilityLabel: "Back", children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "reply", size: 20, color: theme.colors.text }) }) : null,
995
1137
  /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: avatarUrl, name: title, seed: avatarSeed, online: isOnline, size: "md" }),
996
1138
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles4.titleCol, children: [
997
1139
  /* @__PURE__ */ jsxRuntime.jsx(
998
1140
  reactNative.Text,
999
1141
  {
1000
- style: [styles4.title, { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }],
1142
+ style: [styles4.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
1001
1143
  numberOfLines: 1,
1002
1144
  children: title
1003
1145
  }
1004
1146
  ),
1005
- subtitle ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.subtitle, { color: theme.colors.ink3 }], numberOfLines: 1, children: subtitle }) : null
1147
+ subtitle ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.subtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: subtitle }) : null
1006
1148
  ] }),
1007
1149
  onMembersPress ? /* @__PURE__ */ jsxRuntime.jsx(
1008
1150
  reactNative.Pressable,
@@ -1011,7 +1153,7 @@ function ChatHeader({
1011
1153
  hitSlop: 12,
1012
1154
  style: styles4.actionBtn,
1013
1155
  accessibilityLabel: "Show members",
1014
- children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "users", size: 20, color: theme.colors.ink2 })
1156
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "users", size: 20, color: theme.colors.textMuted })
1015
1157
  }
1016
1158
  ) : null
1017
1159
  ]
@@ -1077,7 +1219,7 @@ function ConversationList({
1077
1219
  labelFor,
1078
1220
  avatarFor
1079
1221
  }) {
1080
- const theme = usePoolseTheme();
1222
+ const theme = useTheme();
1081
1223
  const auto = react$1.useConversations();
1082
1224
  const { me } = react$1.useMe();
1083
1225
  const meExternalId = me?.external_id ?? null;
@@ -1088,20 +1230,20 @@ function ConversationList({
1088
1230
  const error = isControlled ? controlledError ?? null : auto.error;
1089
1231
  const counts = unreadCounts ?? (isControlled ? void 0 : auto.unreadCounts);
1090
1232
  if (loading && conversations.length === 0) {
1091
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.placeholder, { backgroundColor: theme.colors.paper }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.brand }) });
1233
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.accent }) });
1092
1234
  }
1093
1235
  if (error) {
1094
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.placeholder, { backgroundColor: theme.colors.paper }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.error, fontFamily: theme.type.fontBody }, children: "Failed to load conversations." }) });
1236
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.danger, fontFamily: theme.fonts.body }, children: "Failed to load conversations." }) });
1095
1237
  }
1096
1238
  if (conversations.length === 0) {
1097
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.placeholder, { backgroundColor: theme.colors.paper }], children: typeof emptyState === "string" || emptyState == null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.ink3, fontFamily: theme.type.fontBody }, children: emptyState ?? "No conversations yet." }) : emptyState });
1239
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.placeholder, { backgroundColor: theme.colors.background }], children: typeof emptyState === "string" || emptyState == null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState ?? "No conversations yet." }) : emptyState });
1098
1240
  }
1099
1241
  return /* @__PURE__ */ jsxRuntime.jsx(
1100
1242
  reactNative.FlatList,
1101
1243
  {
1102
1244
  data: conversations,
1103
1245
  keyExtractor: (c) => c.id,
1104
- style: { backgroundColor: theme.colors.paper },
1246
+ style: { backgroundColor: theme.colors.background },
1105
1247
  renderItem: ({ item }) => {
1106
1248
  const selected = selectedId === item.id;
1107
1249
  if (renderItem) {
@@ -1134,7 +1276,7 @@ function ConversationRow({
1134
1276
  avatarFor,
1135
1277
  onSelect
1136
1278
  }) {
1137
- const theme = usePoolseTheme();
1279
+ const theme = useTheme();
1138
1280
  const isDirect = conv.type === "direct";
1139
1281
  const otherExtId = isDirect && meExternalId ? (conv.member_external_ids ?? []).find((x) => x !== meExternalId) ?? null : null;
1140
1282
  const resolvedOther = react$1.useUser(isDirect ? otherExtId : null);
@@ -1148,7 +1290,7 @@ function ConversationRow({
1148
1290
  style: [
1149
1291
  styles5.row,
1150
1292
  {
1151
- backgroundColor: selected ? theme.colors.surface2 : "transparent"
1293
+ backgroundColor: selected ? theme.colors.surfaceAlt : "transparent"
1152
1294
  }
1153
1295
  ],
1154
1296
  children: [
@@ -1157,14 +1299,14 @@ function ConversationRow({
1157
1299
  /* @__PURE__ */ jsxRuntime.jsx(
1158
1300
  reactNative.Text,
1159
1301
  {
1160
- style: [styles5.name, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
1302
+ style: [styles5.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
1161
1303
  numberOfLines: 1,
1162
1304
  children: title
1163
1305
  }
1164
1306
  ),
1165
- conv.last_message_preview ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles5.preview, { color: theme.colors.ink3 }], numberOfLines: 1, children: react$1.formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview }) : conv.last_message_at ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles5.preview, { color: theme.colors.ink3 }], numberOfLines: 1, children: formatRelative(conv.last_message_at) }) : null
1307
+ conv.last_message_preview ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles5.preview, { color: theme.colors.textSubtle }], numberOfLines: 1, children: react$1.formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview }) : conv.last_message_at ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles5.preview, { color: theme.colors.textSubtle }], numberOfLines: 1, children: formatRelative(conv.last_message_at) }) : null
1166
1308
  ] }),
1167
- unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.unreadPill, { backgroundColor: theme.colors.unreadPill }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles5.unreadText, { color: theme.colors.unreadPillText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
1309
+ unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles5.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
1168
1310
  ]
1169
1311
  }
1170
1312
  );
@@ -1255,7 +1397,7 @@ function AttachmentPicker({
1255
1397
  onPickInputs,
1256
1398
  camera = true
1257
1399
  }) {
1258
- const theme = usePoolseTheme();
1400
+ const theme = useTheme();
1259
1401
  const insets = useSafeInsets();
1260
1402
  const upload = useSharedUpload();
1261
1403
  const { setPreview } = useUploadPreview();
@@ -1302,18 +1444,18 @@ function AttachmentPicker({
1302
1444
  ],
1303
1445
  children: [
1304
1446
  camera ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles6.item, onPress: () => pickFromKind("camera"), children: [
1305
- /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "camera", size: 20, color: theme.colors.ink2 }),
1306
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.itemText, { color: theme.colors.ink }], children: "Camera" })
1447
+ /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "camera", size: 20, color: theme.colors.textMuted }),
1448
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.itemText, { color: theme.colors.text }], children: "Camera" })
1307
1449
  ] }) : null,
1308
1450
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles6.item, onPress: () => pickFromKind("image"), children: [
1309
- /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "image", size: 20, color: theme.colors.ink2 }),
1310
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.itemText, { color: theme.colors.ink }], children: "Photo or video" })
1451
+ /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "image", size: 20, color: theme.colors.textMuted }),
1452
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.itemText, { color: theme.colors.text }], children: "Photo or video" })
1311
1453
  ] }),
1312
1454
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles6.item, onPress: () => pickFromKind("document"), children: [
1313
- /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 20, color: theme.colors.ink2 }),
1314
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.itemText, { color: theme.colors.ink }], children: "File" })
1455
+ /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 20, color: theme.colors.textMuted }),
1456
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.itemText, { color: theme.colors.text }], children: "File" })
1315
1457
  ] }),
1316
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles6.cancel, onPress: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.itemText, { color: theme.colors.brand }], children: "Cancel" }) })
1458
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles6.cancel, onPress: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.itemText, { color: theme.colors.accent }], children: "Cancel" }) })
1317
1459
  ]
1318
1460
  }
1319
1461
  ) })
@@ -1491,39 +1633,53 @@ var styles6 = reactNative.StyleSheet.create({
1491
1633
  fontWeight: "500"
1492
1634
  }
1493
1635
  });
1494
- function DaySeparator({ label }) {
1495
- const theme = usePoolseTheme();
1496
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.wrap, children: /* @__PURE__ */ jsxRuntime.jsx(
1497
- reactNative.View,
1498
- {
1499
- style: [
1500
- styles7.chip,
1501
- {
1502
- backgroundColor: theme.colors.surface2,
1503
- borderColor: theme.colors.border
1504
- }
1505
- ],
1506
- children: /* @__PURE__ */ jsxRuntime.jsx(
1507
- reactNative.Text,
1508
- {
1509
- style: [
1510
- styles7.label,
1511
- {
1512
- color: theme.colors.ink2,
1513
- fontFamily: theme.type.fontBody
1514
- }
1515
- ],
1516
- children: label
1517
- }
1518
- )
1519
- }
1520
- ) });
1636
+ function DaySeparator({ label, variant = "pill" }) {
1637
+ const theme = useTheme();
1638
+ const rule = variant === "rule" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles7.rule, { backgroundColor: theme.colors.border }] }) : null;
1639
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles7.wrap, rule ? styles7.wrapRule : null], children: [
1640
+ rule,
1641
+ /* @__PURE__ */ jsxRuntime.jsx(
1642
+ reactNative.View,
1643
+ {
1644
+ style: [
1645
+ styles7.chip,
1646
+ {
1647
+ backgroundColor: theme.colors.surfaceAlt,
1648
+ borderColor: theme.colors.border
1649
+ }
1650
+ ],
1651
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1652
+ reactNative.Text,
1653
+ {
1654
+ style: [
1655
+ styles7.label,
1656
+ {
1657
+ color: theme.colors.textMuted,
1658
+ fontFamily: theme.fonts.body
1659
+ }
1660
+ ],
1661
+ children: label
1662
+ }
1663
+ )
1664
+ }
1665
+ ),
1666
+ rule
1667
+ ] });
1521
1668
  }
1522
1669
  var styles7 = reactNative.StyleSheet.create({
1523
1670
  wrap: {
1524
1671
  alignItems: "center",
1525
1672
  marginVertical: 8
1526
1673
  },
1674
+ wrapRule: {
1675
+ flexDirection: "row",
1676
+ gap: 10,
1677
+ paddingHorizontal: 12
1678
+ },
1679
+ rule: {
1680
+ flex: 1,
1681
+ height: reactNative.StyleSheet.hairlineWidth
1682
+ },
1527
1683
  chip: {
1528
1684
  paddingHorizontal: 12,
1529
1685
  paddingVertical: 4,
@@ -1537,7 +1693,7 @@ var styles7 = reactNative.StyleSheet.create({
1537
1693
  }
1538
1694
  });
1539
1695
  function LiveCallBanner({ call, inCall, onJoin }) {
1540
- const theme = usePoolseTheme();
1696
+ const theme = useTheme();
1541
1697
  const what = call.kind === "room" ? call.media === "video" ? "Video room" : "Voice room" : call.media === "video" ? "Video call in progress" : "Voice call in progress";
1542
1698
  const who = inCall > 0 ? `${inCall} ${call.kind === "room" ? "in the room" : "on the call"}` : call.kind === "room" ? "Starting" : "Ringing";
1543
1699
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1557,8 +1713,8 @@ function LiveCallBanner({ call, inCall, onJoin }) {
1557
1713
  }
1558
1714
  ),
1559
1715
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles8.text, children: [
1560
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.title, { fontFamily: theme.type.fontBody }], numberOfLines: 1, children: what }),
1561
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.meta, { fontFamily: theme.type.fontBody }], numberOfLines: 1, children: who })
1716
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.title, { fontFamily: theme.fonts.body }], numberOfLines: 1, children: what }),
1717
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.meta, { fontFamily: theme.fonts.body }], numberOfLines: 1, children: who })
1562
1718
  ] }),
1563
1719
  /* @__PURE__ */ jsxRuntime.jsx(
1564
1720
  reactNative.Pressable,
@@ -1571,10 +1727,7 @@ function LiveCallBanner({ call, inCall, onJoin }) {
1571
1727
  children: /* @__PURE__ */ jsxRuntime.jsx(
1572
1728
  reactNative.Text,
1573
1729
  {
1574
- style: [
1575
- styles8.joinText,
1576
- { color: theme.colors.success, fontFamily: theme.type.fontBody }
1577
- ],
1730
+ style: [styles8.joinText, { color: theme.colors.success, fontFamily: theme.fonts.body }],
1578
1731
  children: "Join"
1579
1732
  }
1580
1733
  )
@@ -1605,7 +1758,7 @@ var styles8 = reactNative.StyleSheet.create({
1605
1758
  joinText: { fontSize: 14, fontWeight: "700" }
1606
1759
  });
1607
1760
  function UploadQueueStrip() {
1608
- const theme = usePoolseTheme();
1761
+ const theme = useTheme();
1609
1762
  const upload = useSharedUpload();
1610
1763
  const { getPreview } = useUploadPreview();
1611
1764
  if (upload.queue.length === 0) return null;
@@ -1646,7 +1799,7 @@ function UploadQueueStrip() {
1646
1799
  children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 11, color: "#fff" })
1647
1800
  }
1648
1801
  ) : null,
1649
- isUploading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles9.progressOverlay, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles9.spinner, { borderColor: theme.colors.onBrand }] }) }) : null,
1802
+ isUploading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles9.progressOverlay, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles9.spinner, { borderColor: theme.colors.accentText }] }) }) : null,
1650
1803
  isError ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles9.errorOverlay, { backgroundColor: "rgba(229,72,77,0.85)" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.errorText, { color: "#fff" }], children: "Failed" }) }) : null
1651
1804
  ] }, item.localId);
1652
1805
  })
@@ -1654,7 +1807,7 @@ function UploadQueueStrip() {
1654
1807
  );
1655
1808
  }
1656
1809
  function ImageTile({ uri, uploading, error }) {
1657
- const theme = usePoolseTheme();
1810
+ const theme = useTheme();
1658
1811
  return /* @__PURE__ */ jsxRuntime.jsx(
1659
1812
  reactNative.Image,
1660
1813
  {
@@ -1662,8 +1815,8 @@ function ImageTile({ uri, uploading, error }) {
1662
1815
  style: [
1663
1816
  styles9.imageTile,
1664
1817
  {
1665
- backgroundColor: theme.colors.surface2,
1666
- borderColor: error ? theme.colors.error : "transparent",
1818
+ backgroundColor: theme.colors.surfaceAlt,
1819
+ borderColor: error ? theme.colors.danger : "transparent",
1667
1820
  opacity: uploading ? 0.65 : 1
1668
1821
  }
1669
1822
  ],
@@ -1677,29 +1830,29 @@ function FileTile({
1677
1830
  uploading,
1678
1831
  error
1679
1832
  }) {
1680
- const theme = usePoolseTheme();
1833
+ const theme = useTheme();
1681
1834
  return /* @__PURE__ */ jsxRuntime.jsxs(
1682
1835
  reactNative.View,
1683
1836
  {
1684
1837
  style: [
1685
1838
  styles9.fileTile,
1686
1839
  {
1687
- backgroundColor: theme.colors.surface2,
1688
- borderColor: error ? theme.colors.error : uploading ? theme.colors.brand : theme.colors.border
1840
+ backgroundColor: theme.colors.surfaceAlt,
1841
+ borderColor: error ? theme.colors.danger : uploading ? theme.colors.accent : theme.colors.border
1689
1842
  }
1690
1843
  ],
1691
1844
  children: [
1692
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles9.fileIconBox, { backgroundColor: theme.colors.brandSoft }], children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 18, color: theme.colors.brand }) }),
1845
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles9.fileIconBox, { backgroundColor: theme.colors.accentSoft }], children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 18, color: theme.colors.accent }) }),
1693
1846
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles9.fileInfo, children: [
1694
1847
  /* @__PURE__ */ jsxRuntime.jsx(
1695
1848
  reactNative.Text,
1696
1849
  {
1697
- style: [styles9.fileName, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
1850
+ style: [styles9.fileName, { color: theme.colors.text, fontFamily: theme.fonts.body }],
1698
1851
  numberOfLines: 1,
1699
1852
  children: filename
1700
1853
  }
1701
1854
  ),
1702
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.fileSize, { color: theme.colors.ink3 }], children: formatBytes(size) })
1855
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.fileSize, { color: theme.colors.textSubtle }], children: formatBytes(size) })
1703
1856
  ] })
1704
1857
  ]
1705
1858
  }
@@ -1848,7 +2001,7 @@ var MessageComposer = react.forwardRef(
1848
2001
  onCancelEdit,
1849
2002
  onSaveEdit
1850
2003
  }, ref) {
1851
- const theme = usePoolseTheme();
2004
+ const theme = useTheme();
1852
2005
  const inputRef = react.useRef(null);
1853
2006
  const [value, setValue] = react.useState("");
1854
2007
  const [sending, setSending] = react.useState(false);
@@ -1948,7 +2101,7 @@ var MessageComposer = react.forwardRef(
1948
2101
  hitSlop: 8,
1949
2102
  style: styles10.iconBtn,
1950
2103
  accessibilityLabel: "Attach file",
1951
- children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 22, color: theme.colors.ink2 })
2104
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 22, color: theme.colors.textMuted })
1952
2105
  }
1953
2106
  ) : null,
1954
2107
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1961,17 +2114,17 @@ var MessageComposer = react.forwardRef(
1961
2114
  onTyping?.();
1962
2115
  },
1963
2116
  placeholder,
1964
- placeholderTextColor: theme.colors.ink3,
2117
+ placeholderTextColor: theme.colors.textSubtle,
1965
2118
  multiline: true,
1966
2119
  editable: !disabled,
1967
2120
  style: [
1968
2121
  styles10.input,
1969
2122
  {
1970
- color: theme.colors.ink,
1971
- backgroundColor: theme.colors.surface2,
2123
+ color: theme.colors.text,
2124
+ backgroundColor: theme.colors.surfaceAlt,
1972
2125
  borderRadius: theme.radii.lg,
1973
- fontFamily: theme.type.fontBody,
1974
- fontSize: theme.type.bodySize
2126
+ fontFamily: theme.fonts.body,
2127
+ fontSize: theme.fonts.sizeMd
1975
2128
  }
1976
2129
  ]
1977
2130
  }
@@ -1984,12 +2137,12 @@ var MessageComposer = react.forwardRef(
1984
2137
  style: [
1985
2138
  styles10.sendBtn,
1986
2139
  {
1987
- backgroundColor: submitDisabled ? theme.colors.ink3 : theme.colors.brand,
2140
+ backgroundColor: submitDisabled ? theme.colors.textSubtle : theme.colors.accent,
1988
2141
  opacity: submitDisabled ? 0.6 : 1
1989
2142
  }
1990
2143
  ],
1991
2144
  accessibilityLabel: "Send message",
1992
- children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "send", size: 18, color: theme.colors.onBrand })
2145
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "send", size: 18, color: theme.colors.accentText })
1993
2146
  }
1994
2147
  )
1995
2148
  ] })
@@ -1999,23 +2152,23 @@ var MessageComposer = react.forwardRef(
1999
2152
  }
2000
2153
  );
2001
2154
  function EditChip({ message, onCancel }) {
2002
- const theme = usePoolseTheme();
2155
+ const theme = useTheme();
2003
2156
  return /* @__PURE__ */ jsxRuntime.jsxs(
2004
2157
  reactNative.View,
2005
2158
  {
2006
2159
  style: [
2007
2160
  styles10.replyChip,
2008
2161
  {
2009
- backgroundColor: theme.colors.surface2,
2010
- borderLeftColor: theme.colors.brand
2162
+ backgroundColor: theme.colors.surfaceAlt,
2163
+ borderLeftColor: theme.colors.accent
2011
2164
  }
2012
2165
  ],
2013
2166
  children: [
2014
2167
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flex: 1 }, children: [
2015
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.replyName, { color: theme.colors.brand }], children: "Editing message" }),
2016
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.replyBody, { color: theme.colors.ink2 }], numberOfLines: 1, children: message.body ?? "\u2026" })
2168
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.replyName, { color: theme.colors.accent }], children: "Editing message" }),
2169
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.replyBody, { color: theme.colors.textMuted }], numberOfLines: 1, children: message.body ?? "\u2026" })
2017
2170
  ] }),
2018
- onCancel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onCancel, hitSlop: 8, style: styles10.replyCancel, children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.ink2 }) }) : null
2171
+ onCancel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onCancel, hitSlop: 8, style: styles10.replyCancel, children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
2019
2172
  ]
2020
2173
  }
2021
2174
  );
@@ -2025,7 +2178,7 @@ function ReplyChip({
2025
2178
  labelFor,
2026
2179
  onCancel
2027
2180
  }) {
2028
- const theme = usePoolseTheme();
2181
+ const theme = useTheme();
2029
2182
  const resolved = react$1.useUser(message.sender_external_id);
2030
2183
  const senderName = message.sender_external_id ? labelFor?.(message.sender_external_id) ?? resolved.profile?.displayName ?? message.sender_external_id : "Unknown";
2031
2184
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2034,19 +2187,19 @@ function ReplyChip({
2034
2187
  style: [
2035
2188
  styles10.replyChip,
2036
2189
  {
2037
- backgroundColor: theme.colors.surface2,
2038
- borderLeftColor: theme.colors.brand
2190
+ backgroundColor: theme.colors.surfaceAlt,
2191
+ borderLeftColor: theme.colors.accent
2039
2192
  }
2040
2193
  ],
2041
2194
  children: [
2042
2195
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flex: 1 }, children: [
2043
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles10.replyName, { color: theme.colors.brand }], children: [
2196
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles10.replyName, { color: theme.colors.accent }], children: [
2044
2197
  "Replying to ",
2045
2198
  senderName
2046
2199
  ] }),
2047
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.replyBody, { color: theme.colors.ink2 }], numberOfLines: 1, children: message.body ?? "\u2026" })
2200
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.replyBody, { color: theme.colors.textMuted }], numberOfLines: 1, children: message.body ?? "\u2026" })
2048
2201
  ] }),
2049
- onCancel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onCancel, hitSlop: 8, style: styles10.replyCancel, children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.ink2 }) }) : null
2202
+ onCancel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onCancel, hitSlop: 8, style: styles10.replyCancel, children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 16, color: theme.colors.textMuted }) }) : null
2050
2203
  ]
2051
2204
  }
2052
2205
  );
@@ -2109,7 +2262,7 @@ var styles10 = reactNative.StyleSheet.create({
2109
2262
  }
2110
2263
  });
2111
2264
  function MentionInput({ conversationId, onSend, ...composerProps }) {
2112
- const theme = usePoolseTheme();
2265
+ const theme = useTheme();
2113
2266
  const insets = useSafeInsets();
2114
2267
  const keyboardOpen = useKeyboardOpen();
2115
2268
  const { members } = react$1.useMembers(conversationId);
@@ -2171,7 +2324,7 @@ function MentionInput({ conversationId, onSend, ...composerProps }) {
2171
2324
  /* @__PURE__ */ jsxRuntime.jsx(
2172
2325
  reactNative.Text,
2173
2326
  {
2174
- style: [styles11.title, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
2327
+ style: [styles11.title, { color: theme.colors.text, fontFamily: theme.fonts.body }],
2175
2328
  children: "Mention a member"
2176
2329
  }
2177
2330
  ),
@@ -2202,10 +2355,10 @@ function MentionInput({ conversationId, onSend, ...composerProps }) {
2202
2355
  ] });
2203
2356
  }
2204
2357
  function MentionRow({ member, onPress }) {
2205
- const theme = usePoolseTheme();
2358
+ const theme = useTheme();
2206
2359
  return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress, style: styles11.row, children: [
2207
2360
  /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: null, name: member.external_id, seed: member.external_id, size: "sm" }),
2208
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.rowText, { color: theme.colors.ink, fontFamily: theme.type.fontBody }], children: member.external_id })
2361
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.rowText, { color: theme.colors.text, fontFamily: theme.fonts.body }], children: member.external_id })
2209
2362
  ] });
2210
2363
  }
2211
2364
  var styles11 = reactNative.StyleSheet.create({
@@ -2265,7 +2418,7 @@ function MessageList({
2265
2418
  scrollToMessageId = null,
2266
2419
  scrollRequest = 0
2267
2420
  }) {
2268
- const theme = usePoolseTheme();
2421
+ const theme = useTheme();
2269
2422
  const flatListRef = react.useRef(null);
2270
2423
  const [atBottom, setAtBottom] = react.useState(true);
2271
2424
  const [newCount, setNewCount] = react.useState(0);
@@ -2333,10 +2486,10 @@ function MessageList({
2333
2486
  [renderItem, data.length]
2334
2487
  );
2335
2488
  if (loading && messages.length === 0) {
2336
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles12.placeholder, { backgroundColor: theme.colors.paper }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.brand }) });
2489
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles12.placeholder, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.accent }) });
2337
2490
  }
2338
2491
  if (messages.length === 0) {
2339
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles12.placeholder, { backgroundColor: theme.colors.paper }], children: typeof emptyState === "string" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.ink3, fontFamily: theme.type.fontBody }, children: emptyState }) : emptyState ?? null });
2492
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles12.placeholder, { backgroundColor: theme.colors.background }], children: typeof emptyState === "string" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }, children: emptyState }) : emptyState ?? null });
2340
2493
  }
2341
2494
  return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles12.root, children: [
2342
2495
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2354,10 +2507,10 @@ function MessageList({
2354
2507
  scrollEventThrottle: 32,
2355
2508
  ListHeaderComponent: ListHeader,
2356
2509
  ListFooterComponent: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
2357
- hasMore && loading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.ink3, style: { marginVertical: 8 } }) : null,
2510
+ hasMore && loading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.colors.textSubtle, style: { marginVertical: 8 } }) : null,
2358
2511
  ListFooter
2359
2512
  ] }),
2360
- style: { backgroundColor: theme.colors.paper },
2513
+ style: { backgroundColor: theme.colors.background },
2361
2514
  contentContainerStyle: { paddingVertical: 8 }
2362
2515
  }
2363
2516
  ),
@@ -2368,14 +2521,14 @@ function MessageList({
2368
2521
  style: [
2369
2522
  styles12.jumpButton,
2370
2523
  {
2371
- backgroundColor: theme.colors.brand
2524
+ backgroundColor: theme.colors.accent
2372
2525
  },
2373
2526
  theme.shadows.sm
2374
2527
  ],
2375
2528
  accessibilityLabel: `${newCount} new ${newCount === 1 ? "message" : "messages"}, jump to latest`,
2376
2529
  children: [
2377
- /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "chevron-down", size: 14, color: theme.colors.onBrand }),
2378
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles12.jumpText, { color: theme.colors.onBrand }], children: [
2530
+ /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "chevron-down", size: 14, color: theme.colors.accentText }),
2531
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles12.jumpText, { color: theme.colors.accentText }], children: [
2379
2532
  newCount,
2380
2533
  " new ",
2381
2534
  newCount === 1 ? "message" : "messages"
@@ -2412,13 +2565,13 @@ var styles12 = reactNative.StyleSheet.create({
2412
2565
  }
2413
2566
  });
2414
2567
  function CallLogRow({ msg, meId, onCallBack }) {
2415
- const theme = usePoolseTheme();
2568
+ const theme = useTheme();
2416
2569
  const display = react$1.callLogDisplayFor(msg, meId);
2417
2570
  if (!display) return null;
2418
- const accent = display.missed ? theme.colors.error : theme.colors.ink3;
2571
+ const accent = display.missed ? theme.colors.danger : theme.colors.textSubtle;
2419
2572
  const time = formatTime(msg.inserted_at);
2420
2573
  const label = [display.title, display.detail, time].filter(Boolean).join(", ");
2421
- const metaStyle = [styles13.meta, { color: theme.colors.ink3, fontFamily: theme.type.fontBody }];
2574
+ const metaStyle = [styles13.meta, { color: theme.colors.textSubtle, fontFamily: theme.fonts.body }];
2422
2575
  return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles13.wrap, accessible: true, accessibilityLabel: label, children: [
2423
2576
  /* @__PURE__ */ jsxRuntime.jsxs(
2424
2577
  reactNative.View,
@@ -2426,7 +2579,7 @@ function CallLogRow({ msg, meId, onCallBack }) {
2426
2579
  style: [
2427
2580
  styles13.chip,
2428
2581
  {
2429
- backgroundColor: theme.colors.surface2,
2582
+ backgroundColor: theme.colors.surfaceAlt,
2430
2583
  borderColor: theme.colors.border
2431
2584
  }
2432
2585
  ],
@@ -2438,8 +2591,8 @@ function CallLogRow({ msg, meId, onCallBack }) {
2438
2591
  style: [
2439
2592
  styles13.title,
2440
2593
  {
2441
- color: display.missed ? theme.colors.error : theme.colors.ink2,
2442
- fontFamily: theme.type.fontBody
2594
+ color: display.missed ? theme.colors.danger : theme.colors.textMuted,
2595
+ fontFamily: theme.fonts.body
2443
2596
  }
2444
2597
  ],
2445
2598
  numberOfLines: 1,
@@ -2470,7 +2623,7 @@ function CallLogRow({ msg, meId, onCallBack }) {
2470
2623
  {
2471
2624
  style: [
2472
2625
  styles13.callBackText,
2473
- { color: theme.colors.brand, fontFamily: theme.type.fontBody }
2626
+ { color: theme.colors.accent, fontFamily: theme.fonts.body }
2474
2627
  ],
2475
2628
  children: "Call back"
2476
2629
  }
@@ -2518,149 +2671,13 @@ var styles13 = reactNative.StyleSheet.create({
2518
2671
  fontVariant: ["tabular-nums"]
2519
2672
  }
2520
2673
  });
2521
- var DEFAULT_REACTION_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F64F}", "\u{1F525}"];
2522
- function MessageActions({
2523
- visible,
2524
- onClose,
2525
- isSelf,
2526
- emojis = DEFAULT_REACTION_EMOJIS,
2527
- onPickReaction,
2528
- onReply,
2529
- onReplyInThread,
2530
- onQuote,
2531
- onEdit,
2532
- onDelete,
2533
- onCopy
2534
- }) {
2535
- const theme = usePoolseTheme();
2536
- const insets = useSafeInsets();
2537
- const items = [];
2538
- if (onReply) items.push({ label: "Reply", icon: "reply", onPress: onReply });
2539
- if (onQuote) items.push({ label: "Quote reply", icon: "reply", onPress: onQuote });
2540
- if (onReplyInThread)
2541
- items.push({ label: "Reply in thread", icon: "messages", onPress: onReplyInThread });
2542
- if (onCopy) items.push({ label: "Copy text", icon: "copy", onPress: onCopy });
2543
- if (isSelf && onEdit) items.push({ label: "Edit", icon: "edit", onPress: onEdit });
2544
- if (isSelf && onDelete)
2545
- items.push({ label: "Delete", icon: "trash", onPress: onDelete, danger: true });
2546
- const showEmojiRow = !!onPickReaction && emojis.length > 0;
2547
- return /* @__PURE__ */ jsxRuntime.jsx(
2548
- reactNative.Modal,
2549
- {
2550
- visible,
2551
- transparent: true,
2552
- animationType: "fade",
2553
- onRequestClose: onClose,
2554
- ...EDGE_TO_EDGE_MODAL,
2555
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles14.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
2556
- reactNative.View,
2557
- {
2558
- style: [
2559
- styles14.sheet,
2560
- {
2561
- backgroundColor: theme.colors.surface,
2562
- borderTopLeftRadius: theme.radii.lg,
2563
- borderTopRightRadius: theme.radii.lg,
2564
- // Last action row must sit above the nav bar / home indicator.
2565
- paddingBottom: 24 + insets.bottom,
2566
- paddingLeft: insets.left,
2567
- paddingRight: insets.right
2568
- },
2569
- theme.shadows.lg
2570
- ],
2571
- children: [
2572
- showEmojiRow ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles14.emojiRow, { borderBottomColor: theme.colors.border }], children: emojis.map((emoji) => /* @__PURE__ */ jsxRuntime.jsx(
2573
- reactNative.Pressable,
2574
- {
2575
- onPress: () => {
2576
- onPickReaction(emoji);
2577
- onClose();
2578
- },
2579
- style: styles14.emojiBtn,
2580
- hitSlop: 6,
2581
- accessibilityLabel: `React with ${emoji}`,
2582
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles14.emoji, children: emoji })
2583
- },
2584
- emoji
2585
- )) }) : null,
2586
- items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress: item.onPress, style: styles14.item, children: [
2587
- /* @__PURE__ */ jsxRuntime.jsx(
2588
- PoolseIcon,
2589
- {
2590
- name: item.icon,
2591
- size: 18,
2592
- color: item.danger ? theme.colors.error : theme.colors.ink2
2593
- }
2594
- ),
2595
- /* @__PURE__ */ jsxRuntime.jsx(
2596
- reactNative.Text,
2597
- {
2598
- style: [
2599
- styles14.itemText,
2600
- {
2601
- color: item.danger ? theme.colors.error : theme.colors.ink,
2602
- fontFamily: theme.type.fontBody
2603
- }
2604
- ],
2605
- children: item.label
2606
- }
2607
- )
2608
- ] }, item.label))
2609
- ]
2610
- }
2611
- ) })
2612
- }
2613
- );
2614
- }
2615
- var styles14 = reactNative.StyleSheet.create({
2616
- backdrop: {
2617
- flex: 1,
2618
- backgroundColor: "rgba(0,0,0,0.35)",
2619
- justifyContent: "flex-end"
2620
- },
2621
- sheet: {
2622
- paddingTop: 8,
2623
- paddingBottom: 24
2624
- },
2625
- emojiRow: {
2626
- flexDirection: "row",
2627
- alignItems: "center",
2628
- justifyContent: "space-around",
2629
- paddingHorizontal: 12,
2630
- paddingVertical: 10,
2631
- borderBottomWidth: reactNative.StyleSheet.hairlineWidth,
2632
- marginBottom: 6
2633
- },
2634
- emojiBtn: {
2635
- paddingHorizontal: 6,
2636
- paddingVertical: 6,
2637
- borderRadius: 999,
2638
- alignItems: "center",
2639
- justifyContent: "center"
2640
- },
2641
- emoji: {
2642
- fontSize: 30,
2643
- lineHeight: 36
2644
- },
2645
- item: {
2646
- flexDirection: "row",
2647
- alignItems: "center",
2648
- paddingHorizontal: 20,
2649
- paddingVertical: 14,
2650
- gap: 14
2651
- },
2652
- itemText: {
2653
- fontSize: 15,
2654
- fontWeight: "500"
2655
- }
2656
- });
2657
2674
  function AttachmentPreview({
2658
2675
  attachment,
2659
2676
  onPress,
2660
2677
  maxWidth = 280,
2661
2678
  tone = "default"
2662
2679
  }) {
2663
- const theme = usePoolseTheme();
2680
+ const theme = useTheme();
2664
2681
  const isImage = (attachment.content_type ?? "").startsWith("image/");
2665
2682
  const { url } = react$1.useAttachmentUrl(attachment.id);
2666
2683
  if (isImage) {
@@ -2672,7 +2689,7 @@ function AttachmentPreview({
2672
2689
  width: maxWidth,
2673
2690
  height: 200,
2674
2691
  borderRadius: theme.radii.md,
2675
- backgroundColor: theme.colors.surface2
2692
+ backgroundColor: theme.colors.surfaceAlt
2676
2693
  },
2677
2694
  resizeMode: "cover",
2678
2695
  accessible: true,
@@ -2682,45 +2699,45 @@ function AttachmentPreview({
2682
2699
  reactNative.View,
2683
2700
  {
2684
2701
  style: [
2685
- styles15.imagePlaceholder,
2702
+ styles14.imagePlaceholder,
2686
2703
  {
2687
2704
  width: maxWidth,
2688
2705
  height: 200,
2689
2706
  borderRadius: theme.radii.md,
2690
- backgroundColor: theme.colors.surface2
2707
+ backgroundColor: theme.colors.surfaceAlt
2691
2708
  }
2692
2709
  ]
2693
2710
  }
2694
2711
  ) });
2695
2712
  }
2696
2713
  const onBrand = tone === "onBrand";
2697
- const ink = onBrand ? theme.colors.onBrand : theme.colors.ink;
2698
- const inkSoft = onBrand ? theme.colors.onBrand : theme.colors.ink3;
2714
+ const ink = onBrand ? theme.colors.ownBubbleText : theme.colors.text;
2715
+ const inkSoft = onBrand ? theme.colors.ownBubbleText : theme.colors.textSubtle;
2699
2716
  return /* @__PURE__ */ jsxRuntime.jsxs(
2700
2717
  reactNative.Pressable,
2701
2718
  {
2702
2719
  onPress,
2703
2720
  disabled: !onPress,
2704
2721
  style: [
2705
- styles15.fileCard,
2722
+ styles14.fileCard,
2706
2723
  {
2707
- backgroundColor: onBrand ? "rgba(255,255,255,0.18)" : theme.colors.surface2,
2724
+ backgroundColor: onBrand ? "rgba(255,255,255,0.18)" : theme.colors.surfaceAlt,
2708
2725
  borderColor: onBrand ? "transparent" : theme.colors.border,
2709
2726
  borderRadius: theme.radii.md
2710
2727
  }
2711
2728
  ],
2712
2729
  children: [
2713
- /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 18, color: onBrand ? ink : theme.colors.ink2 }),
2730
+ /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "attachment", size: 18, color: onBrand ? ink : theme.colors.textMuted }),
2714
2731
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flex: 1, marginLeft: 8 }, children: [
2715
2732
  /* @__PURE__ */ jsxRuntime.jsx(
2716
2733
  reactNative.Text,
2717
2734
  {
2718
- style: [styles15.fileName, { color: ink, fontFamily: theme.type.fontBody }],
2735
+ style: [styles14.fileName, { color: ink, fontFamily: theme.fonts.body }],
2719
2736
  numberOfLines: 1,
2720
2737
  children: attachment.original_filename ?? "file"
2721
2738
  }
2722
2739
  ),
2723
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.fileSize, { color: inkSoft, opacity: onBrand ? 0.8 : 1 }], children: formatBytes2(attachment.byte_size) })
2740
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.fileSize, { color: inkSoft, opacity: onBrand ? 0.8 : 1 }], children: formatBytes2(attachment.byte_size) })
2724
2741
  ] })
2725
2742
  ]
2726
2743
  }
@@ -2732,7 +2749,7 @@ function formatBytes2(n) {
2732
2749
  if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
2733
2750
  return `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
2734
2751
  }
2735
- var styles15 = reactNative.StyleSheet.create({
2752
+ var styles14 = reactNative.StyleSheet.create({
2736
2753
  imagePlaceholder: {},
2737
2754
  fileCard: {
2738
2755
  flexDirection: "row",
@@ -2755,7 +2772,7 @@ function ImageMosaic({
2755
2772
  squareBottom = false,
2756
2773
  onLongPress
2757
2774
  }) {
2758
- const theme = usePoolseTheme();
2775
+ const theme = useTheme();
2759
2776
  const r = radius ?? theme.radii.md;
2760
2777
  const rBottom = squareBottom ? 5 : r;
2761
2778
  const [viewerIndex, setViewerIndex] = react.useState(null);
@@ -2768,7 +2785,7 @@ function ImageMosaic({
2768
2785
  reactNative.View,
2769
2786
  {
2770
2787
  style: [
2771
- styles16.root,
2788
+ styles15.root,
2772
2789
  {
2773
2790
  borderTopLeftRadius: r,
2774
2791
  borderTopRightRadius: r,
@@ -2789,18 +2806,18 @@ function ImageMosaic({
2789
2806
  {
2790
2807
  onLongPress,
2791
2808
  attachment: visible[0],
2792
- style: styles16.tileFull,
2809
+ style: styles15.tileFull,
2793
2810
  onPress: () => setViewerIndex(0),
2794
2811
  overlay: null
2795
2812
  }
2796
2813
  ) : null,
2797
- n === 2 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles16.rowEven, children: [
2814
+ n === 2 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.rowEven, children: [
2798
2815
  /* @__PURE__ */ jsxRuntime.jsx(
2799
2816
  Tile,
2800
2817
  {
2801
2818
  onLongPress,
2802
2819
  attachment: visible[0],
2803
- style: styles16.tileHalfSquare,
2820
+ style: styles15.tileHalfSquare,
2804
2821
  onPress: () => setViewerIndex(0),
2805
2822
  overlay: null
2806
2823
  }
@@ -2810,7 +2827,7 @@ function ImageMosaic({
2810
2827
  {
2811
2828
  onLongPress,
2812
2829
  attachment: visible[1],
2813
- style: styles16.tileHalfSquare,
2830
+ style: styles15.tileHalfSquare,
2814
2831
  onPress: () => setViewerIndex(1),
2815
2832
  overlay: null
2816
2833
  }
@@ -2822,18 +2839,18 @@ function ImageMosaic({
2822
2839
  {
2823
2840
  onLongPress,
2824
2841
  attachment: visible[0],
2825
- style: styles16.tileHero,
2842
+ style: styles15.tileHero,
2826
2843
  onPress: () => setViewerIndex(0),
2827
2844
  overlay: null
2828
2845
  }
2829
2846
  ),
2830
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles16.rowEven, { marginTop: 2 }], children: [
2847
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles15.rowEven, { marginTop: 2 }], children: [
2831
2848
  /* @__PURE__ */ jsxRuntime.jsx(
2832
2849
  Tile,
2833
2850
  {
2834
2851
  onLongPress,
2835
2852
  attachment: visible[1],
2836
- style: styles16.tileHalfSquare,
2853
+ style: styles15.tileHalfSquare,
2837
2854
  onPress: () => setViewerIndex(1),
2838
2855
  overlay: null
2839
2856
  }
@@ -2843,7 +2860,7 @@ function ImageMosaic({
2843
2860
  {
2844
2861
  onLongPress,
2845
2862
  attachment: visible[2],
2846
- style: styles16.tileHalfSquare,
2863
+ style: styles15.tileHalfSquare,
2847
2864
  onPress: () => setViewerIndex(2),
2848
2865
  overlay: null
2849
2866
  }
@@ -2851,13 +2868,13 @@ function ImageMosaic({
2851
2868
  ] })
2852
2869
  ] }) : null,
2853
2870
  n === 4 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2854
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles16.rowEven, children: [
2871
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.rowEven, children: [
2855
2872
  /* @__PURE__ */ jsxRuntime.jsx(
2856
2873
  Tile,
2857
2874
  {
2858
2875
  onLongPress,
2859
2876
  attachment: visible[0],
2860
- style: styles16.tileHalfSquare,
2877
+ style: styles15.tileHalfSquare,
2861
2878
  onPress: () => setViewerIndex(0),
2862
2879
  overlay: null
2863
2880
  }
@@ -2867,19 +2884,19 @@ function ImageMosaic({
2867
2884
  {
2868
2885
  onLongPress,
2869
2886
  attachment: visible[1],
2870
- style: styles16.tileHalfSquare,
2887
+ style: styles15.tileHalfSquare,
2871
2888
  onPress: () => setViewerIndex(1),
2872
2889
  overlay: null
2873
2890
  }
2874
2891
  )
2875
2892
  ] }),
2876
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles16.rowEven, { marginTop: 2 }], children: [
2893
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles15.rowEven, { marginTop: 2 }], children: [
2877
2894
  /* @__PURE__ */ jsxRuntime.jsx(
2878
2895
  Tile,
2879
2896
  {
2880
2897
  onLongPress,
2881
2898
  attachment: visible[2],
2882
- style: styles16.tileHalfSquare,
2899
+ style: styles15.tileHalfSquare,
2883
2900
  onPress: () => setViewerIndex(2),
2884
2901
  overlay: null
2885
2902
  }
@@ -2889,7 +2906,7 @@ function ImageMosaic({
2889
2906
  {
2890
2907
  onLongPress,
2891
2908
  attachment: visible[3],
2892
- style: styles16.tileHalfSquare,
2909
+ style: styles15.tileHalfSquare,
2893
2910
  onPress: () => setViewerIndex(3),
2894
2911
  overlay: overflow > 0 ? `+${overflow}` : null
2895
2912
  }
@@ -2925,20 +2942,20 @@ function Tile({
2925
2942
  onPress,
2926
2943
  onLongPress
2927
2944
  }) {
2928
- const theme = usePoolseTheme();
2945
+ const theme = useTheme();
2929
2946
  const { url } = react$1.useAttachmentUrl(attachment.id);
2930
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress, onLongPress, style: [styles16.tileBase, style], children: [
2947
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress, onLongPress, style: [styles15.tileBase, style], children: [
2931
2948
  url ? /* @__PURE__ */ jsxRuntime.jsx(
2932
2949
  reactNative.Image,
2933
2950
  {
2934
2951
  source: { uri: url },
2935
- style: [styles16.tileImage, { backgroundColor: theme.colors.surface2 }],
2952
+ style: [styles15.tileImage, { backgroundColor: theme.colors.surfaceAlt }],
2936
2953
  resizeMode: "cover",
2937
2954
  accessible: true,
2938
2955
  accessibilityLabel: attachment.original_filename ?? "image"
2939
2956
  }
2940
- ) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles16.tileImage, { backgroundColor: theme.colors.surface2 }] }),
2941
- overlay ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles16.overflow, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles16.overflowText, children: overlay }) }) : null
2957
+ ) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles15.tileImage, { backgroundColor: theme.colors.surfaceAlt }] }),
2958
+ overlay ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles15.overflow, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles15.overflowText, children: overlay }) }) : null
2942
2959
  ] });
2943
2960
  }
2944
2961
  function FullScreenViewer({
@@ -2948,7 +2965,7 @@ function FullScreenViewer({
2948
2965
  const { url } = react$1.useAttachmentUrl(attachment.id);
2949
2966
  const { width, height } = reactNative.useWindowDimensions();
2950
2967
  const insets = useSafeInsets();
2951
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles16.viewer, onPress: onClose, children: [
2968
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles15.viewer, onPress: onClose, children: [
2952
2969
  url ? /* @__PURE__ */ jsxRuntime.jsx(
2953
2970
  reactNative.Image,
2954
2971
  {
@@ -2964,14 +2981,14 @@ function FullScreenViewer({
2964
2981
  {
2965
2982
  onPress: onClose,
2966
2983
  hitSlop: 12,
2967
- style: [styles16.closeBtn, { top: insets.top + 12, right: insets.right + 16 }],
2984
+ style: [styles15.closeBtn, { top: insets.top + 12, right: insets.right + 16 }],
2968
2985
  accessibilityLabel: "Close viewer",
2969
2986
  children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 20, color: "#ffffff" })
2970
2987
  }
2971
2988
  )
2972
2989
  ] });
2973
2990
  }
2974
- var styles16 = reactNative.StyleSheet.create({
2991
+ var styles15 = reactNative.StyleSheet.create({
2975
2992
  root: {
2976
2993
  width: "100%",
2977
2994
  overflow: "hidden",
@@ -3097,72 +3114,238 @@ function renderMarkdown(body, args) {
3097
3114
  };
3098
3115
  return react.createElement(Markdown__default.default, { style, markdownit, onLinkPress: args.onLinkPress }, body);
3099
3116
  }
3100
- function MessageBubble({
3101
- message,
3102
- currentUserId,
3103
- readState,
3104
- labelFor,
3105
- onQuotedClick,
3106
- groupPosition = "standalone",
3107
- maxBodyLength = 0,
3108
- showSenderName = false,
3109
- onSenderPress,
3110
- actionsTrigger,
3111
- showAttachments = true,
3112
- markdown = true,
3113
- onLongPress
3114
- }) {
3115
- const theme = usePoolseTheme();
3116
- const { width: screenWidth } = reactNative.useWindowDimensions();
3117
- const isSelf = currentUserId !== null && message.sender_id === currentUserId;
3118
- const [expanded, setExpanded] = react.useState(false);
3119
- const [lastLineWidth, setLastLineWidth] = react.useState(null);
3120
- const [textBoxWidth, setTextBoxWidth] = react.useState(null);
3121
- const [metaWidth, setMetaWidth] = react.useState(null);
3122
- const bubbleMaxWidth = Math.floor(screenWidth * 0.78);
3123
- const mediaWidth = Math.min(bubbleMaxWidth - 6, 420);
3124
- const sender = react$1.useUser(!isSelf ? message.sender_external_id : null);
3125
- const senderFallbackName = message.sender_external_id ?? "Unknown";
3126
- const senderLabel = sender.profile?.displayName ?? (message.sender_external_id ? labelFor?.(message.sender_external_id) ?? senderFallbackName : senderFallbackName);
3127
- const senderTint = userColor(message.sender_external_id ?? message.sender_id ?? message.id);
3128
- const tailCorner = groupPosition === "last" || groupPosition === "standalone";
3129
- const bubbleRadius = theme.radii.bubble;
3130
- const textColor = isSelf ? theme.colors.selfBubbleText : theme.colors.otherBubbleText;
3131
- const mutedOnBubble = isSelf ? theme.colors.onBrand : theme.colors.ink3;
3132
- const radii2 = {
3133
- topLeft: bubbleRadius,
3134
- topRight: bubbleRadius,
3135
- bottomLeft: bubbleRadius,
3136
- bottomRight: bubbleRadius
3137
- };
3138
- if (tailCorner) {
3139
- if (isSelf) radii2.bottomRight = 5;
3140
- else radii2.bottomLeft = 5;
3117
+
3118
+ // src/layout.ts
3119
+ function formatClock(date, format2) {
3120
+ if (typeof format2 === "function") return format2(date);
3121
+ if (format2 === "12h") {
3122
+ return date.toLocaleTimeString([], { hour: "numeric", minute: "2-digit", hour12: true });
3141
3123
  }
3142
- const body = message.body ?? "";
3143
- const isDeleted = !!message.deleted_at;
3144
- const isEdited = !!message.edited_at && !isDeleted;
3145
- const trimmable = maxBodyLength > 0 && body.length > maxBodyLength;
3146
- const truncated = trimmable && !expanded ? body.slice(0, maxBodyLength) + "\u2026" : body;
3147
- const time = formatTime2(message.inserted_at);
3148
- const images = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
3149
- const files = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
3150
- const hasMedia = images.length > 0;
3151
- const hasFiles = files.length > 0;
3152
- const hasBody = !isDeleted && body.length > 0;
3153
- const metaOverlay = hasMedia && !hasBody && !hasFiles;
3154
- const jumboCount = hasBody && !hasMedia && !hasFiles && !message.quoted_message_id ? emojiOnlyCount(body) : 0;
3124
+ if (format2 === "24h") {
3125
+ return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
3126
+ }
3127
+ return date.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
3128
+ }
3129
+ function formatMessageTime(iso, format2) {
3130
+ if (!iso) return "";
3131
+ const date = new Date(iso);
3132
+ if (Number.isNaN(date.getTime())) return "";
3133
+ return formatClock(date, format2);
3134
+ }
3135
+ function mentionsViewer(msg, meId) {
3136
+ return meId !== null && msg.sender_id !== meId && (msg.mentions ?? []).includes(meId);
3137
+ }
3138
+ function renderSlot(slot, ctx, children) {
3139
+ return slot && ctx ? slot({ ...ctx, children }) : children;
3140
+ }
3141
+ var DEFAULT_REACTION_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F64F}", "\u{1F525}"];
3142
+ function MessageActions({
3143
+ visible,
3144
+ onClose,
3145
+ isSelf,
3146
+ emojis = DEFAULT_REACTION_EMOJIS,
3147
+ onPickReaction,
3148
+ onReply,
3149
+ onReplyInThread,
3150
+ onQuote,
3151
+ onEdit,
3152
+ onDelete,
3153
+ onCopy
3154
+ }) {
3155
+ const theme = useTheme();
3156
+ const insets = useSafeInsets();
3157
+ const items = [];
3158
+ if (onReply) items.push({ label: "Reply", icon: "reply", onPress: onReply });
3159
+ if (onQuote) items.push({ label: "Quote reply", icon: "reply", onPress: onQuote });
3160
+ if (onReplyInThread)
3161
+ items.push({ label: "Reply in thread", icon: "messages", onPress: onReplyInThread });
3162
+ if (onCopy) items.push({ label: "Copy text", icon: "copy", onPress: onCopy });
3163
+ if (isSelf && onEdit) items.push({ label: "Edit", icon: "edit", onPress: onEdit });
3164
+ if (isSelf && onDelete)
3165
+ items.push({ label: "Delete", icon: "trash", onPress: onDelete, danger: true });
3166
+ const showEmojiRow = !!onPickReaction && emojis.length > 0;
3167
+ return /* @__PURE__ */ jsxRuntime.jsx(
3168
+ reactNative.Modal,
3169
+ {
3170
+ visible,
3171
+ transparent: true,
3172
+ animationType: "fade",
3173
+ onRequestClose: onClose,
3174
+ ...EDGE_TO_EDGE_MODAL,
3175
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles16.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
3176
+ reactNative.View,
3177
+ {
3178
+ style: [
3179
+ styles16.sheet,
3180
+ {
3181
+ backgroundColor: theme.colors.surface,
3182
+ borderTopLeftRadius: theme.radii.lg,
3183
+ borderTopRightRadius: theme.radii.lg,
3184
+ // Last action row must sit above the nav bar / home indicator.
3185
+ paddingBottom: 24 + insets.bottom,
3186
+ paddingLeft: insets.left,
3187
+ paddingRight: insets.right
3188
+ },
3189
+ theme.shadows.lg
3190
+ ],
3191
+ children: [
3192
+ showEmojiRow ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles16.emojiRow, { borderBottomColor: theme.colors.border }], children: emojis.map((emoji) => /* @__PURE__ */ jsxRuntime.jsx(
3193
+ reactNative.Pressable,
3194
+ {
3195
+ onPress: () => {
3196
+ onPickReaction(emoji);
3197
+ onClose();
3198
+ },
3199
+ style: styles16.emojiBtn,
3200
+ hitSlop: 6,
3201
+ accessibilityLabel: `React with ${emoji}`,
3202
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles16.emoji, children: emoji })
3203
+ },
3204
+ emoji
3205
+ )) }) : null,
3206
+ items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress: item.onPress, style: styles16.item, children: [
3207
+ /* @__PURE__ */ jsxRuntime.jsx(
3208
+ PoolseIcon,
3209
+ {
3210
+ name: item.icon,
3211
+ size: 18,
3212
+ color: item.danger ? theme.colors.danger : theme.colors.textMuted
3213
+ }
3214
+ ),
3215
+ /* @__PURE__ */ jsxRuntime.jsx(
3216
+ reactNative.Text,
3217
+ {
3218
+ style: [
3219
+ styles16.itemText,
3220
+ {
3221
+ color: item.danger ? theme.colors.danger : theme.colors.text,
3222
+ fontFamily: theme.fonts.body
3223
+ }
3224
+ ],
3225
+ children: item.label
3226
+ }
3227
+ )
3228
+ ] }, item.label))
3229
+ ]
3230
+ }
3231
+ ) })
3232
+ }
3233
+ );
3234
+ }
3235
+ var styles16 = reactNative.StyleSheet.create({
3236
+ backdrop: {
3237
+ flex: 1,
3238
+ backgroundColor: "rgba(0,0,0,0.35)",
3239
+ justifyContent: "flex-end"
3240
+ },
3241
+ sheet: {
3242
+ paddingTop: 8,
3243
+ paddingBottom: 24
3244
+ },
3245
+ emojiRow: {
3246
+ flexDirection: "row",
3247
+ alignItems: "center",
3248
+ justifyContent: "space-around",
3249
+ paddingHorizontal: 12,
3250
+ paddingVertical: 10,
3251
+ borderBottomWidth: reactNative.StyleSheet.hairlineWidth,
3252
+ marginBottom: 6
3253
+ },
3254
+ emojiBtn: {
3255
+ paddingHorizontal: 6,
3256
+ paddingVertical: 6,
3257
+ borderRadius: 999,
3258
+ alignItems: "center",
3259
+ justifyContent: "center"
3260
+ },
3261
+ emoji: {
3262
+ fontSize: 30,
3263
+ lineHeight: 36
3264
+ },
3265
+ item: {
3266
+ flexDirection: "row",
3267
+ alignItems: "center",
3268
+ paddingHorizontal: 20,
3269
+ paddingVertical: 14,
3270
+ gap: 14
3271
+ },
3272
+ itemText: {
3273
+ fontSize: 15,
3274
+ fontWeight: "500"
3275
+ }
3276
+ });
3277
+ function MessageBubble({
3278
+ message,
3279
+ currentUserId,
3280
+ readState,
3281
+ labelFor,
3282
+ onQuotedClick,
3283
+ groupPosition = "standalone",
3284
+ maxBodyLength = 0,
3285
+ showSenderName = false,
3286
+ onSenderPress,
3287
+ actionsTrigger,
3288
+ showAttachments = true,
3289
+ markdown = true,
3290
+ onLongPress,
3291
+ timeFormat,
3292
+ density = "comfortable",
3293
+ slots,
3294
+ slotContext
3295
+ }) {
3296
+ const dense = density === "compact";
3297
+ const theme = useTheme();
3298
+ const { width: screenWidth } = reactNative.useWindowDimensions();
3299
+ const isSelf = currentUserId !== null && message.sender_id === currentUserId;
3300
+ const [expanded, setExpanded] = react.useState(false);
3301
+ const [lastLineWidth, setLastLineWidth] = react.useState(null);
3302
+ const [textBoxWidth, setTextBoxWidth] = react.useState(null);
3303
+ const [metaWidth, setMetaWidth] = react.useState(null);
3304
+ const bubbleMaxWidth = Math.floor(screenWidth * 0.78);
3305
+ const mediaWidth = Math.min(bubbleMaxWidth - 6, 420);
3306
+ const sender = react$1.useUser(!isSelf ? message.sender_external_id : null);
3307
+ const senderFallbackName = message.sender_external_id ?? "Unknown";
3308
+ const senderLabel = sender.profile?.displayName ?? (message.sender_external_id ? labelFor?.(message.sender_external_id) ?? senderFallbackName : senderFallbackName);
3309
+ const senderTint = userColor(message.sender_external_id ?? message.sender_id ?? message.id);
3310
+ const tailCorner = groupPosition === "last" || groupPosition === "standalone";
3311
+ const bubbleRadius = theme.radii.bubble;
3312
+ const textColor = isSelf ? theme.colors.ownBubbleText : theme.colors.otherBubbleText;
3313
+ const mutedOnBubble = isSelf ? theme.colors.ownBubbleText : theme.colors.textSubtle;
3314
+ const radii2 = {
3315
+ topLeft: bubbleRadius,
3316
+ topRight: bubbleRadius,
3317
+ bottomLeft: bubbleRadius,
3318
+ bottomRight: bubbleRadius
3319
+ };
3320
+ if (tailCorner) {
3321
+ if (isSelf) radii2.bottomRight = 5;
3322
+ else radii2.bottomLeft = 5;
3323
+ }
3324
+ const body = message.body ?? "";
3325
+ const isDeleted = !!message.deleted_at;
3326
+ const isEdited = !!message.edited_at && !isDeleted;
3327
+ const trimmable = maxBodyLength > 0 && body.length > maxBodyLength;
3328
+ const truncated = trimmable && !expanded ? body.slice(0, maxBodyLength) + "\u2026" : body;
3329
+ const time = formatTime2(message.inserted_at, timeFormat);
3330
+ const images = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
3331
+ const files = showAttachments && !isDeleted ? (message.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
3332
+ const hasMedia = images.length > 0;
3333
+ const hasFiles = files.length > 0;
3334
+ const hasBody = !isDeleted && body.length > 0;
3335
+ const metaOverlay = hasMedia && !hasBody && !hasFiles;
3336
+ const jumboCount = hasBody && !hasMedia && !hasFiles && !message.quoted_message_id ? emojiOnlyCount(body) : 0;
3155
3337
  const inlineMeta = hasBody && jumboCount === 0 && !trimmable && (!markdown || !hasMarkdown(truncated));
3156
3338
  const sectionAbove = hasMedia || hasFiles || !!message.quoted_message || isDeleted;
3157
3339
  const metaFits = lastLineWidth !== null && textBoxWidth !== null && metaWidth !== null && lastLineWidth + metaWidth + 14 <= textBoxWidth;
3158
3340
  const metaRow = (variant) => {
3159
- const color = variant === "overlay" ? "#FFFFFF" : variant === "jumbo" ? theme.colors.ink3 : mutedOnBubble;
3341
+ const color = variant === "overlay" ? "#FFFFFF" : variant === "jumbo" ? theme.colors.textSubtle : mutedOnBubble;
3160
3342
  return /* @__PURE__ */ jsxRuntime.jsxs(
3161
3343
  reactNative.View,
3162
3344
  {
3163
3345
  style: [
3164
3346
  styles17.metaRow,
3165
3347
  variant === "inline" && styles17.metaInline,
3348
+ variant === "inline" && dense && styles17.metaInlineDense,
3166
3349
  variant === "wrapped" && styles17.metaWrapped,
3167
3350
  variant === "overlay" && styles17.metaOverlay,
3168
3351
  variant === "block" && styles17.metaBlock,
@@ -3201,7 +3384,7 @@ function MessageBubble({
3201
3384
  {
3202
3385
  style: [
3203
3386
  jumboCount === 0 && {
3204
- backgroundColor: isSelf ? theme.colors.selfBubble : theme.colors.otherBubble,
3387
+ backgroundColor: isSelf ? theme.colors.ownBubble : theme.colors.otherBubble,
3205
3388
  borderColor: isSelf ? "transparent" : theme.colors.border,
3206
3389
  borderWidth: isSelf ? 0 : reactNative.StyleSheet.hairlineWidth,
3207
3390
  borderTopLeftRadius: radii2.topLeft,
@@ -3212,18 +3395,22 @@ function MessageBubble({
3212
3395
  jumboCount === 0 && theme.shadows.sm
3213
3396
  ],
3214
3397
  children: [
3215
- showSenderName && !isSelf && jumboCount === 0 && (groupPosition === "first" || groupPosition === "standalone") ? /* @__PURE__ */ jsxRuntime.jsx(
3216
- reactNative.Text,
3217
- {
3218
- style: [styles17.senderName, { color: senderTint, fontFamily: theme.type.fontBody }],
3219
- ...onSenderPress ? {
3220
- onPress: onSenderPress,
3221
- accessibilityRole: "button",
3222
- suppressHighlighting: true
3223
- } : {},
3224
- children: senderLabel
3225
- }
3226
- ) : null,
3398
+ renderSlot(
3399
+ slots?.header,
3400
+ slotContext,
3401
+ showSenderName && !isSelf && jumboCount === 0 && (groupPosition === "first" || groupPosition === "standalone") ? /* @__PURE__ */ jsxRuntime.jsx(
3402
+ reactNative.Text,
3403
+ {
3404
+ style: [styles17.senderName, { color: senderTint, fontFamily: theme.fonts.body }],
3405
+ ...onSenderPress ? {
3406
+ onPress: onSenderPress,
3407
+ accessibilityRole: "button",
3408
+ suppressHighlighting: true
3409
+ } : {},
3410
+ children: senderLabel
3411
+ }
3412
+ ) : null
3413
+ ),
3227
3414
  message.quoted_message ? /* @__PURE__ */ jsxRuntime.jsx(
3228
3415
  QuotedCard,
3229
3416
  {
@@ -3233,104 +3420,130 @@ function MessageBubble({
3233
3420
  ...onQuotedClick ? { onPress: () => onQuotedClick(message.quoted_message.id) } : {}
3234
3421
  }
3235
3422
  ) : null,
3236
- hasMedia ? (
3237
- // 3px of bubble color framing the picture; the mosaic clips
3238
- // itself 3px tighter than the bubble so the curves stay
3239
- // concentric.
3240
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles17.mediaFrame, children: [
3241
- /* @__PURE__ */ jsxRuntime.jsx(
3242
- ImageMosaic,
3423
+ renderSlot(
3424
+ slots?.attachments,
3425
+ slotContext,
3426
+ hasMedia || hasFiles ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3427
+ hasMedia ? (
3428
+ // 3px of bubble color framing the picture; the mosaic clips
3429
+ // itself 3px tighter than the bubble so the curves stay
3430
+ // concentric.
3431
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles17.mediaFrame, children: [
3432
+ /* @__PURE__ */ jsxRuntime.jsx(
3433
+ ImageMosaic,
3434
+ {
3435
+ images,
3436
+ maxWidth: mediaWidth,
3437
+ radius: Math.max(bubbleRadius - 3, 8),
3438
+ squareBottom: !metaOverlay,
3439
+ ...onLongPress ? { onLongPress } : {}
3440
+ }
3441
+ ),
3442
+ metaOverlay ? metaRow("overlay") : null
3443
+ ] })
3444
+ ) : null,
3445
+ hasFiles ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles17.filesBlock, children: files.map((att) => /* @__PURE__ */ jsxRuntime.jsx(
3446
+ AttachmentPreview,
3447
+ {
3448
+ attachment: att,
3449
+ maxWidth: bubbleMaxWidth - 12,
3450
+ tone: isSelf ? "onBrand" : "default"
3451
+ },
3452
+ att.id
3453
+ )) }) : null
3454
+ ] }) : null
3455
+ ),
3456
+ renderSlot(
3457
+ slots?.body,
3458
+ slotContext,
3459
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3460
+ isDeleted ? /* @__PURE__ */ jsxRuntime.jsx(
3461
+ reactNative.View,
3243
3462
  {
3244
- images,
3245
- maxWidth: mediaWidth,
3246
- radius: Math.max(bubbleRadius - 3, 8),
3247
- squareBottom: !metaOverlay,
3248
- ...onLongPress ? { onLongPress } : {}
3463
+ style: [
3464
+ styles17.textBlock,
3465
+ dense && styles17.textBlockDense,
3466
+ sectionAbove && styles17.textBlockAfter
3467
+ ],
3468
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3469
+ reactNative.Text,
3470
+ {
3471
+ style: {
3472
+ color: mutedOnBubble,
3473
+ opacity: 0.7,
3474
+ fontFamily: theme.fonts.body,
3475
+ fontSize: theme.fonts.sizeMd,
3476
+ lineHeight: theme.fonts.lineHeight,
3477
+ fontStyle: "italic"
3478
+ },
3479
+ children: "Message deleted"
3480
+ }
3481
+ )
3249
3482
  }
3250
- ),
3251
- metaOverlay ? metaRow("overlay") : null
3483
+ ) : null,
3484
+ hasBody && jumboCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles17.jumboBlock, children: /* @__PURE__ */ jsxRuntime.jsx(
3485
+ reactNative.Text,
3486
+ {
3487
+ style: {
3488
+ fontSize: emojiFontSize(jumboCount),
3489
+ lineHeight: emojiFontSize(jumboCount) + 8
3490
+ },
3491
+ children: body
3492
+ }
3493
+ ) }) : null,
3494
+ hasBody && jumboCount === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
3495
+ reactNative.View,
3496
+ {
3497
+ style: [
3498
+ styles17.textBlock,
3499
+ dense && styles17.textBlockDense,
3500
+ sectionAbove && styles17.textBlockAfter
3501
+ ],
3502
+ onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
3503
+ children: [
3504
+ markdown && !inlineMeta ? renderMarkdown(truncated, {
3505
+ textColor,
3506
+ linkColor: isSelf ? theme.colors.ownBubbleText : theme.colors.link,
3507
+ fontFamily: theme.fonts.body,
3508
+ fontSize: theme.fonts.sizeMd,
3509
+ lineHeight: theme.fonts.lineHeight,
3510
+ onLinkPress: (url) => {
3511
+ void reactNative.Linking.openURL(url).catch(() => void 0);
3512
+ return false;
3513
+ }
3514
+ }) : /* @__PURE__ */ jsxRuntime.jsx(
3515
+ reactNative.Text,
3516
+ {
3517
+ style: {
3518
+ color: textColor,
3519
+ fontFamily: theme.fonts.body,
3520
+ fontSize: theme.fonts.sizeMd,
3521
+ lineHeight: theme.fonts.lineHeight
3522
+ },
3523
+ onTextLayout: inlineMeta ? (e) => {
3524
+ const lines = e.nativeEvent.lines;
3525
+ const last = lines[lines.length - 1];
3526
+ setLastLineWidth(last ? Math.ceil(last.width) : 0);
3527
+ } : void 0,
3528
+ children: truncated
3529
+ }
3530
+ ),
3531
+ trimmable ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsxRuntime.jsx(
3532
+ reactNative.Text,
3533
+ {
3534
+ style: [
3535
+ styles17.readMore,
3536
+ { color: isSelf ? theme.colors.ownBubbleText : theme.colors.link }
3537
+ ],
3538
+ children: expanded ? "Show less" : "Read more"
3539
+ }
3540
+ ) }) : null,
3541
+ inlineMeta ? metaRow(metaFits ? "inline" : "wrapped") : null
3542
+ ]
3543
+ }
3544
+ ) : null
3252
3545
  ] })
3253
- ) : null,
3254
- hasFiles ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles17.filesBlock, children: files.map((att) => /* @__PURE__ */ jsxRuntime.jsx(
3255
- AttachmentPreview,
3256
- {
3257
- attachment: att,
3258
- maxWidth: bubbleMaxWidth - 12,
3259
- tone: isSelf ? "onBrand" : "default"
3260
- },
3261
- att.id
3262
- )) }) : null,
3263
- isDeleted ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles17.textBlock, sectionAbove && styles17.textBlockAfter], children: /* @__PURE__ */ jsxRuntime.jsx(
3264
- reactNative.Text,
3265
- {
3266
- style: {
3267
- color: mutedOnBubble,
3268
- opacity: 0.7,
3269
- fontFamily: theme.type.fontBody,
3270
- fontSize: theme.type.bodySize,
3271
- lineHeight: theme.type.lineHeight,
3272
- fontStyle: "italic"
3273
- },
3274
- children: "Message deleted"
3275
- }
3276
- ) }) : null,
3277
- hasBody && jumboCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles17.jumboBlock, children: /* @__PURE__ */ jsxRuntime.jsx(
3278
- reactNative.Text,
3279
- {
3280
- style: {
3281
- fontSize: emojiFontSize(jumboCount),
3282
- lineHeight: emojiFontSize(jumboCount) + 8
3283
- },
3284
- children: body
3285
- }
3286
- ) }) : null,
3287
- hasBody && jumboCount === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
3288
- reactNative.View,
3289
- {
3290
- style: [styles17.textBlock, sectionAbove && styles17.textBlockAfter],
3291
- onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
3292
- children: [
3293
- markdown && !inlineMeta ? renderMarkdown(truncated, {
3294
- textColor,
3295
- linkColor: isSelf ? theme.colors.onBrand : theme.colors.brand,
3296
- fontFamily: theme.type.fontBody,
3297
- fontSize: theme.type.bodySize,
3298
- lineHeight: theme.type.lineHeight,
3299
- onLinkPress: (url) => {
3300
- void reactNative.Linking.openURL(url).catch(() => void 0);
3301
- return false;
3302
- }
3303
- }) : /* @__PURE__ */ jsxRuntime.jsx(
3304
- reactNative.Text,
3305
- {
3306
- style: {
3307
- color: textColor,
3308
- fontFamily: theme.type.fontBody,
3309
- fontSize: theme.type.bodySize,
3310
- lineHeight: theme.type.lineHeight
3311
- },
3312
- onTextLayout: inlineMeta ? (e) => {
3313
- const lines = e.nativeEvent.lines;
3314
- const last = lines[lines.length - 1];
3315
- setLastLineWidth(last ? Math.ceil(last.width) : 0);
3316
- } : void 0,
3317
- children: truncated
3318
- }
3319
- ),
3320
- trimmable ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsxRuntime.jsx(
3321
- reactNative.Text,
3322
- {
3323
- style: [
3324
- styles17.readMore,
3325
- { color: isSelf ? theme.colors.onBrand : theme.colors.brand }
3326
- ],
3327
- children: expanded ? "Show less" : "Read more"
3328
- }
3329
- ) }) : null,
3330
- inlineMeta ? metaRow(metaFits ? "inline" : "wrapped") : null
3331
- ]
3332
- }
3333
- ) : null,
3546
+ ),
3334
3547
  !inlineMeta && !metaOverlay && jumboCount === 0 ? metaRow("block") : null,
3335
3548
  actionsTrigger ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles17.actionsSlot, children: actionsTrigger }) : null
3336
3549
  ]
@@ -3347,12 +3560,12 @@ function QuotedCard({
3347
3560
  labelFor,
3348
3561
  onPress
3349
3562
  }) {
3350
- const theme = usePoolseTheme();
3563
+ const theme = useTheme();
3351
3564
  const resolved = react$1.useUser(quoted.sender_external_id);
3352
3565
  const senderName = quoted.sender_external_id ? labelFor?.(quoted.sender_external_id) ?? resolved.profile?.displayName ?? quoted.sender_external_id : "Unknown";
3353
- const bg = isSelf ? "rgba(0,0,0,0.16)" : theme.colors.surface2;
3354
- const accent = isSelf ? theme.colors.onBrand : theme.colors.brand;
3355
- const txt = isSelf ? theme.colors.onBrand : theme.colors.ink;
3566
+ const bg = isSelf ? "rgba(0,0,0,0.16)" : theme.colors.surfaceAlt;
3567
+ const accent = isSelf ? theme.colors.ownBubbleText : theme.colors.accent;
3568
+ const txt = isSelf ? theme.colors.ownBubbleText : theme.colors.text;
3356
3569
  return /* @__PURE__ */ jsxRuntime.jsxs(
3357
3570
  reactNative.Pressable,
3358
3571
  {
@@ -3376,12 +3589,13 @@ function isImageContentType(ct) {
3376
3589
  if (!ct) return false;
3377
3590
  return ct.startsWith("image/");
3378
3591
  }
3379
- function formatTime2(iso) {
3592
+ function formatTime2(iso, format2) {
3380
3593
  try {
3381
3594
  const d = new Date(iso);
3595
+ if (typeof format2 === "function") return format2(d);
3382
3596
  const now = /* @__PURE__ */ new Date();
3383
3597
  const sameDay2 = isSameDay(d, now);
3384
- const time = d.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
3598
+ const time = formatClock(d, format2);
3385
3599
  if (sameDay2) return time;
3386
3600
  const yesterday = new Date(now);
3387
3601
  yesterday.setDate(now.getDate() - 1);
@@ -3421,6 +3635,9 @@ var styles17 = reactNative.StyleSheet.create({
3421
3635
  paddingHorizontal: 12,
3422
3636
  paddingVertical: 7
3423
3637
  },
3638
+ textBlockDense: {
3639
+ paddingVertical: 4
3640
+ },
3424
3641
  // A hair less air when media / files / a quote already sit above.
3425
3642
  textBlockAfter: {
3426
3643
  paddingTop: 6
@@ -3452,6 +3669,10 @@ var styles17 = reactNative.StyleSheet.create({
3452
3669
  // sat visibly low beside a one-line message.
3453
3670
  bottom: 11
3454
3671
  },
3672
+ // Same centring for the tighter `density="compact"` text block.
3673
+ metaInlineDense: {
3674
+ bottom: 8
3675
+ },
3455
3676
  metaOverlay: {
3456
3677
  position: "absolute",
3457
3678
  right: 6,
@@ -3518,7 +3739,7 @@ function ReactionStrip({
3518
3739
  meId,
3519
3740
  initialReactions
3520
3741
  }) {
3521
- const theme = usePoolseTheme();
3742
+ const theme = useTheme();
3522
3743
  const { reactions, addReaction, removeReaction } = react$1.useReactions(messageId, {
3523
3744
  conversationId,
3524
3745
  currentUserId: meId,
@@ -3536,8 +3757,8 @@ function ReactionStrip({
3536
3757
  style: [
3537
3758
  styles18.chip,
3538
3759
  {
3539
- backgroundColor: meReacted ? theme.colors.brandSoft : theme.colors.surface2,
3540
- borderColor: meReacted ? theme.colors.brand : theme.colors.border,
3760
+ backgroundColor: meReacted ? theme.colors.accentSoft : theme.colors.surfaceAlt,
3761
+ borderColor: meReacted ? theme.colors.accent : theme.colors.border,
3541
3762
  borderWidth: meReacted ? 1.5 : 1,
3542
3763
  transform: meReacted ? [{ scale: 1.04 }] : void 0
3543
3764
  }
@@ -3550,7 +3771,7 @@ function ReactionStrip({
3550
3771
  style: [
3551
3772
  styles18.count,
3552
3773
  {
3553
- color: meReacted ? theme.colors.brand : theme.colors.ink2,
3774
+ color: meReacted ? theme.colors.accent : theme.colors.textMuted,
3554
3775
  fontWeight: meReacted ? "700" : "600"
3555
3776
  }
3556
3777
  ],
@@ -3569,7 +3790,7 @@ function ReactionPicker({
3569
3790
  onPick,
3570
3791
  emojis = DEFAULT_EMOJIS
3571
3792
  }) {
3572
- const theme = usePoolseTheme();
3793
+ const theme = useTheme();
3573
3794
  const insets = useSafeInsets();
3574
3795
  return /* @__PURE__ */ jsxRuntime.jsx(
3575
3796
  reactNative.Modal,
@@ -3670,6 +3891,378 @@ var styles18 = reactNative.StyleSheet.create({
3670
3891
  lineHeight: 38
3671
3892
  }
3672
3893
  });
3894
+ var GUTTER = 40;
3895
+ function FlatMessageRow({
3896
+ msg,
3897
+ meId,
3898
+ layout,
3899
+ reactions = true,
3900
+ attachments = true,
3901
+ actions = true,
3902
+ threads = true,
3903
+ quotations = true,
3904
+ markdown = true,
3905
+ readState,
3906
+ isEditing = false,
3907
+ onStartEdit,
3908
+ onDelete,
3909
+ onOpenThread,
3910
+ onQuote,
3911
+ labelFor,
3912
+ onQuotedClick,
3913
+ groupPosition = "standalone",
3914
+ maxBodyLength = 0,
3915
+ showAvatar = layout === "list",
3916
+ avatarFor,
3917
+ onSenderPress,
3918
+ onAvatarPress,
3919
+ density = "comfortable",
3920
+ timeFormat,
3921
+ slots,
3922
+ mentionsMe = false
3923
+ }) {
3924
+ const theme = useTheme();
3925
+ const { width: screenWidth } = reactNative.useWindowDimensions();
3926
+ const compact = layout === "compact";
3927
+ const dense = density === "compact";
3928
+ const isSelf = meId !== null && msg.sender_id === meId;
3929
+ const [actionsOpen, setActionsOpen] = react.useState(false);
3930
+ const [expanded, setExpanded] = react.useState(false);
3931
+ const reactionsApi = react$1.useReactions(msg.id, {
3932
+ conversationId: msg.conversation_id,
3933
+ currentUserId: meId,
3934
+ ...msg.reactions ? { initialReactions: msg.reactions } : {}
3935
+ });
3936
+ const resolved = react$1.useUser(msg.sender_external_id);
3937
+ const ext = msg.sender_external_id;
3938
+ const senderName = ext ? labelFor?.(ext) ?? resolved.profile?.displayName ?? ext : msg.sender_id ? `User ${msg.sender_id.slice(0, 6)}` : "Unknown";
3939
+ const avatarUrl = ext ? avatarFor?.(ext) ?? resolved.profile?.avatarUrl ?? null : null;
3940
+ const sender = {
3941
+ userId: msg.sender_id,
3942
+ externalId: ext,
3943
+ displayName: senderName,
3944
+ avatarUrl
3945
+ };
3946
+ const isRunStart = compact || groupPosition === "first" || groupPosition === "standalone";
3947
+ const ctx = { message: msg, isSelf, sender, layout, isRunStart };
3948
+ const deleted = !!msg.deleted_at;
3949
+ const time = formatMessageTime(msg.inserted_at, timeFormat);
3950
+ const openActions = () => {
3951
+ if (actions && !deleted) setActionsOpen(true);
3952
+ };
3953
+ const text = { fontFamily: theme.fonts.body, color: theme.colors.text };
3954
+ const avatarEl = showAvatar ? /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: avatarUrl, name: senderName, seed: ext, size: compact ? "xs" : "md" }) : null;
3955
+ const avatar = avatarEl && onAvatarPress && !isSelf ? /* @__PURE__ */ jsxRuntime.jsx(
3956
+ reactNative.Pressable,
3957
+ {
3958
+ onPress: () => onAvatarPress(sender),
3959
+ accessibilityRole: "button",
3960
+ accessibilityLabel: senderName,
3961
+ hitSlop: 6,
3962
+ children: avatarEl
3963
+ }
3964
+ ) : avatarEl;
3965
+ const name = /* @__PURE__ */ jsxRuntime.jsx(
3966
+ reactNative.Text,
3967
+ {
3968
+ style: [
3969
+ styles19.name,
3970
+ text,
3971
+ compact ? { color: userColor(ext ?? msg.sender_id ?? msg.id) } : null,
3972
+ compact ? styles19.nameCompact : null
3973
+ ],
3974
+ numberOfLines: 1,
3975
+ ...onSenderPress && !isSelf ? {
3976
+ onPress: () => onSenderPress(sender),
3977
+ accessibilityRole: "button",
3978
+ suppressHighlighting: true
3979
+ } : {},
3980
+ children: senderName
3981
+ }
3982
+ );
3983
+ const timeText = (dim) => /* @__PURE__ */ jsxRuntime.jsx(
3984
+ reactNative.Text,
3985
+ {
3986
+ style: [
3987
+ styles19.time,
3988
+ { color: theme.colors.textSubtle, fontFamily: theme.fonts.body },
3989
+ dim ? styles19.timeDim : null
3990
+ ],
3991
+ children: time
3992
+ }
3993
+ );
3994
+ const header = compact ? name : isRunStart ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles19.header, children: [
3995
+ name,
3996
+ timeText(false)
3997
+ ] }) : null;
3998
+ const images = attachments && !deleted ? (msg.attachments ?? []).filter((a) => isImageContentType(a.content_type)) : [];
3999
+ const files = attachments && !deleted ? (msg.attachments ?? []).filter((a) => !isImageContentType(a.content_type)) : [];
4000
+ const mediaWidth = Math.min(screenWidth - GUTTER - 48, 320);
4001
+ const attachmentsEl = images.length > 0 || files.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles19.attachments, children: [
4002
+ images.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
4003
+ ImageMosaic,
4004
+ {
4005
+ images,
4006
+ maxWidth: mediaWidth,
4007
+ radius: theme.radii.md,
4008
+ onLongPress: openActions
4009
+ }
4010
+ ) : null,
4011
+ files.map((att) => /* @__PURE__ */ jsxRuntime.jsx(AttachmentPreview, { attachment: att, maxWidth: mediaWidth }, att.id))
4012
+ ] }) : null;
4013
+ const raw = msg.body ?? "";
4014
+ const trimmable = maxBodyLength > 0 && raw.length > maxBodyLength;
4015
+ const shown = trimmable && !expanded ? raw.slice(0, maxBodyLength) + "\u2026" : raw;
4016
+ const jumbo = raw && images.length === 0 && files.length === 0 && !msg.quoted_message_id ? emojiOnlyCount(raw) : 0;
4017
+ const bodyText = {
4018
+ ...text,
4019
+ fontSize: dense ? theme.fonts.sizeMd - 1 : theme.fonts.sizeMd,
4020
+ lineHeight: dense ? theme.fonts.lineHeight - 3 : theme.fonts.lineHeight
4021
+ };
4022
+ const edited = !!msg.edited_at && !deleted;
4023
+ const meta = edited || isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles19.meta, children: [
4024
+ edited ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles19.edited, { color: theme.colors.textSubtle }], children: "(edited)" }) : null,
4025
+ isSelf && readState ? /* @__PURE__ */ jsxRuntime.jsx(
4026
+ PoolseIcon,
4027
+ {
4028
+ name: readState === "read" ? "check-double" : "check",
4029
+ size: 13,
4030
+ color: readState === "read" ? theme.colors.accent : theme.colors.textSubtle
4031
+ }
4032
+ ) : null
4033
+ ] }) : null;
4034
+ const body = deleted ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [bodyText, styles19.deleted, { color: theme.colors.textMuted }], children: "Message deleted" }) : raw ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
4035
+ jumbo > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { fontSize: emojiFontSize(jumbo), lineHeight: emojiFontSize(jumbo) + 8 }, children: raw }) : markdown && hasMarkdown(shown) ? renderMarkdown(shown, {
4036
+ textColor: bodyText.color,
4037
+ linkColor: theme.colors.link,
4038
+ fontFamily: theme.fonts.body,
4039
+ fontSize: bodyText.fontSize,
4040
+ lineHeight: bodyText.lineHeight,
4041
+ onLinkPress: (url) => {
4042
+ void reactNative.Linking.openURL(url).catch(() => void 0);
4043
+ return false;
4044
+ }
4045
+ }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: bodyText, children: shown }),
4046
+ trimmable ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles19.readMore, { color: theme.colors.link }], children: expanded ? "Show less" : "Read more" }) }) : null,
4047
+ meta
4048
+ ] }) : meta;
4049
+ const replyCount = msg.reply_count ?? 0;
4050
+ const threadEl = threads && !deleted && !msg.thread_root_id && replyCount > 0 && onOpenThread ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { onPress: onOpenThread, style: styles19.thread, accessibilityRole: "button", children: [
4051
+ /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "messages", size: 13, color: theme.colors.link }),
4052
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles19.threadText, { color: theme.colors.link }], children: [
4053
+ replyCount,
4054
+ " ",
4055
+ replyCount === 1 ? "reply" : "replies"
4056
+ ] })
4057
+ ] }) : null;
4058
+ const reactionsEl = reactions && !deleted ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles19.reactions, children: /* @__PURE__ */ jsxRuntime.jsx(
4059
+ ReactionStrip,
4060
+ {
4061
+ messageId: msg.id,
4062
+ conversationId: msg.conversation_id,
4063
+ meId,
4064
+ ...msg.reactions ? { initialReactions: msg.reactions } : {}
4065
+ }
4066
+ ) }) : null;
4067
+ const quote = msg.quoted_message ? /* @__PURE__ */ jsxRuntime.jsx(
4068
+ QuotedCard,
4069
+ {
4070
+ quoted: msg.quoted_message,
4071
+ isSelf: false,
4072
+ ...labelFor ? { labelFor } : {},
4073
+ ...onQuotedClick ? { onPress: () => onQuotedClick(msg.quoted_message.id) } : {}
4074
+ }
4075
+ ) : null;
4076
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles19.content, children: [
4077
+ !compact ? renderSlot(slots?.header, ctx, header) : null,
4078
+ quote,
4079
+ renderSlot(slots?.attachments, ctx, attachmentsEl),
4080
+ renderSlot(slots?.body, ctx, body),
4081
+ renderSlot(slots?.reactions, ctx, reactionsEl),
4082
+ renderSlot(slots?.thread, ctx, threadEl)
4083
+ ] });
4084
+ const close = () => setActionsOpen(false);
4085
+ const sheet = actions && actionsOpen ? /* @__PURE__ */ jsxRuntime.jsx(
4086
+ MessageActions,
4087
+ {
4088
+ visible: true,
4089
+ onClose: close,
4090
+ isSelf,
4091
+ ...reactions ? { onPickReaction: (emoji) => void reactionsApi.addReaction(emoji) } : {},
4092
+ ...msg.body && !deleted ? {
4093
+ onCopy: () => {
4094
+ close();
4095
+ void Clipboard__namespace.setStringAsync(msg.body ?? "");
4096
+ }
4097
+ } : {},
4098
+ ...onStartEdit ? {
4099
+ onEdit: () => {
4100
+ close();
4101
+ onStartEdit();
4102
+ }
4103
+ } : {},
4104
+ ...onDelete ? {
4105
+ onDelete: () => {
4106
+ close();
4107
+ onDelete();
4108
+ }
4109
+ } : {},
4110
+ ...threads && onOpenThread ? {
4111
+ onReplyInThread: () => {
4112
+ close();
4113
+ onOpenThread();
4114
+ }
4115
+ } : {},
4116
+ ...quotations && onQuote ? {
4117
+ onQuote: () => {
4118
+ close();
4119
+ onQuote();
4120
+ }
4121
+ } : {}
4122
+ }
4123
+ ) : null;
4124
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4125
+ reactNative.View,
4126
+ {
4127
+ style: [
4128
+ styles19.row,
4129
+ compact ? styles19.rowCompact : null,
4130
+ dense ? styles19.rowDense : null,
4131
+ !compact && isRunStart ? dense ? styles19.runStartDense : styles19.runStart : null,
4132
+ mentionsMe ? { backgroundColor: theme.colors.mention, borderLeftColor: theme.colors.accent } : null,
4133
+ isEditing ? styles19.rowEditing : null
4134
+ ],
4135
+ children: [
4136
+ /* @__PURE__ */ jsxRuntime.jsx(
4137
+ reactNative.Pressable,
4138
+ {
4139
+ onLongPress: openActions,
4140
+ style: [styles19.line, compact ? styles19.lineCompact : null],
4141
+ accessibilityRole: "button",
4142
+ accessibilityLabel: "Message actions",
4143
+ children: compact ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4144
+ timeText(false),
4145
+ avatar ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles19.avatarCompact, children: avatar }) : null,
4146
+ renderSlot(slots?.header, ctx, header),
4147
+ content
4148
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4149
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles19.gutter, children: isRunStart ? avatar : timeText(true) }),
4150
+ content
4151
+ ] })
4152
+ }
4153
+ ),
4154
+ renderSlot(slots?.actions, ctx, sheet)
4155
+ ]
4156
+ }
4157
+ );
4158
+ }
4159
+ var styles19 = reactNative.StyleSheet.create({
4160
+ row: {
4161
+ // 3px left border reserved for the mention accent bar.
4162
+ borderLeftWidth: 3,
4163
+ borderLeftColor: "transparent",
4164
+ paddingLeft: 9,
4165
+ paddingRight: 12,
4166
+ paddingVertical: 2
4167
+ },
4168
+ rowCompact: {
4169
+ paddingVertical: 1
4170
+ },
4171
+ rowDense: {
4172
+ paddingVertical: 0
4173
+ },
4174
+ runStart: {
4175
+ marginTop: 8,
4176
+ paddingTop: 4
4177
+ },
4178
+ runStartDense: {
4179
+ marginTop: 4,
4180
+ paddingTop: 2
4181
+ },
4182
+ rowEditing: {
4183
+ // Above ConversationView's edit backdrop, like the bubble row.
4184
+ zIndex: 10,
4185
+ elevation: 10
4186
+ },
4187
+ line: {
4188
+ flexDirection: "row",
4189
+ alignItems: "flex-start",
4190
+ gap: 8
4191
+ },
4192
+ lineCompact: {
4193
+ gap: 6
4194
+ },
4195
+ gutter: {
4196
+ width: GUTTER,
4197
+ alignItems: "center"
4198
+ },
4199
+ avatarCompact: {
4200
+ marginTop: 1
4201
+ },
4202
+ content: {
4203
+ flex: 1,
4204
+ minWidth: 0
4205
+ },
4206
+ header: {
4207
+ flexDirection: "row",
4208
+ alignItems: "baseline",
4209
+ gap: 8
4210
+ },
4211
+ name: {
4212
+ fontSize: 14,
4213
+ fontWeight: "700",
4214
+ flexShrink: 1
4215
+ },
4216
+ nameCompact: {
4217
+ maxWidth: "35%",
4218
+ flexShrink: 0
4219
+ },
4220
+ time: {
4221
+ fontSize: 11,
4222
+ fontVariant: ["tabular-nums"],
4223
+ lineHeight: 20
4224
+ },
4225
+ timeDim: {
4226
+ fontSize: 10,
4227
+ opacity: 0.7
4228
+ },
4229
+ attachments: {
4230
+ marginVertical: 4,
4231
+ gap: 4
4232
+ },
4233
+ deleted: {
4234
+ fontStyle: "italic"
4235
+ },
4236
+ readMore: {
4237
+ fontSize: 12,
4238
+ fontWeight: "600",
4239
+ marginTop: 2
4240
+ },
4241
+ meta: {
4242
+ flexDirection: "row",
4243
+ alignItems: "center",
4244
+ gap: 4,
4245
+ marginTop: 1
4246
+ },
4247
+ edited: {
4248
+ fontSize: 11
4249
+ },
4250
+ reactions: {
4251
+ marginTop: 4,
4252
+ alignSelf: "flex-start"
4253
+ },
4254
+ thread: {
4255
+ flexDirection: "row",
4256
+ alignItems: "center",
4257
+ gap: 4,
4258
+ marginTop: 4,
4259
+ alignSelf: "flex-start"
4260
+ },
4261
+ threadText: {
4262
+ fontSize: 12.5,
4263
+ fontWeight: "600"
4264
+ }
4265
+ });
3673
4266
  var SWIPE_REPLY_THRESHOLD = 50;
3674
4267
  function MessageRow(props) {
3675
4268
  const callLog = react$1.callLogDisplayFor(props.msg, props.meId);
@@ -3683,6 +4276,9 @@ function MessageRow(props) {
3683
4276
  }
3684
4277
  ) : null;
3685
4278
  }
4279
+ if (props.layout === "list" || props.layout === "compact") {
4280
+ return /* @__PURE__ */ jsxRuntime.jsx(FlatMessageRow, { ...props, layout: props.layout });
4281
+ }
3686
4282
  return /* @__PURE__ */ jsxRuntime.jsx(BubbleMessageRow, { ...props });
3687
4283
  }
3688
4284
  function BubbleMessageRow({
@@ -3708,9 +4304,12 @@ function BubbleMessageRow({
3708
4304
  showAvatar = false,
3709
4305
  avatarFor,
3710
4306
  onSenderPress,
3711
- onAvatarPress
4307
+ onAvatarPress,
4308
+ density = "comfortable",
4309
+ timeFormat,
4310
+ slots
3712
4311
  }) {
3713
- const theme = usePoolseTheme();
4312
+ const theme = useTheme();
3714
4313
  const isSelf = meId !== null && msg.sender_id === meId;
3715
4314
  const [actionsOpen, setActionsOpen] = react.useState(false);
3716
4315
  const reactionsApi = react$1.useReactions(msg.id, {
@@ -3801,6 +4400,13 @@ function BubbleMessageRow({
3801
4400
  displayName: senderLabel ?? "Unknown",
3802
4401
  avatarUrl
3803
4402
  };
4403
+ const slotContext = {
4404
+ message: msg,
4405
+ isSelf,
4406
+ sender,
4407
+ layout: "bubbles",
4408
+ isRunStart: groupPosition === "first" || groupPosition === "standalone"
4409
+ };
3804
4410
  const avatar = /* @__PURE__ */ jsxRuntime.jsx(
3805
4411
  Avatar,
3806
4412
  {
@@ -3814,15 +4420,16 @@ function BubbleMessageRow({
3814
4420
  reactNative.View,
3815
4421
  {
3816
4422
  style: [
3817
- styles19.row,
4423
+ styles20.row,
3818
4424
  { alignSelf: isSelf ? "flex-end" : "flex-start" },
4425
+ density === "compact" ? styles20.rowDense : null,
3819
4426
  // Lift this row above the dim backdrop the parent renders
3820
4427
  // during edit mode. zIndex covers iOS / web; elevation does
3821
4428
  // the equivalent on Android.
3822
- isEditing ? styles19.rowEditing : null
4429
+ isEditing ? styles20.rowEditing : null
3823
4430
  ],
3824
4431
  children: [
3825
- showAvatarSlot ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles19.avatarSlot, children: !showAvatarRender ? null : onAvatarPress ? /* @__PURE__ */ jsxRuntime.jsx(
4432
+ showAvatarSlot ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles20.avatarSlot, children: !showAvatarRender ? null : onAvatarPress ? /* @__PURE__ */ jsxRuntime.jsx(
3826
4433
  reactNative.Pressable,
3827
4434
  {
3828
4435
  onPress: () => onAvatarPress(sender),
@@ -3832,21 +4439,21 @@ function BubbleMessageRow({
3832
4439
  children: avatar
3833
4440
  }
3834
4441
  ) : avatar }) : null,
3835
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles19.bubbleCol, children: [
4442
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles20.bubbleCol, children: [
3836
4443
  swipeEnabled ? /* @__PURE__ */ jsxRuntime.jsx(
3837
4444
  reactNative.Animated.View,
3838
4445
  {
3839
4446
  pointerEvents: "none",
3840
4447
  style: [
3841
- styles19.replyHint,
3842
- isSelf ? styles19.replyHintRight : styles19.replyHintLeft,
4448
+ styles20.replyHint,
4449
+ isSelf ? styles20.replyHintRight : styles20.replyHintLeft,
3843
4450
  {
3844
4451
  opacity: replyIconOpacity,
3845
4452
  transform: [{ scale: replyIconScale }],
3846
- backgroundColor: theme.colors.surface2
4453
+ backgroundColor: theme.colors.surfaceAlt
3847
4454
  }
3848
4455
  ],
3849
- children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "reply", size: 16, color: theme.colors.brand })
4456
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "reply", size: 16, color: theme.colors.accent })
3850
4457
  }
3851
4458
  ) : null,
3852
4459
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3877,6 +4484,9 @@ function BubbleMessageRow({
3877
4484
  ...onSenderPress ? { onSenderPress: () => onSenderPress(sender) } : {},
3878
4485
  showAttachments: attachments,
3879
4486
  markdown,
4487
+ density,
4488
+ ...timeFormat ? { timeFormat } : {},
4489
+ ...slots ? { slots, slotContext } : {},
3880
4490
  onLongPress: () => {
3881
4491
  if (actions) setActionsOpen(true);
3882
4492
  }
@@ -3886,72 +4496,84 @@ function BubbleMessageRow({
3886
4496
  )
3887
4497
  }
3888
4498
  ),
3889
- threads && (msg.reply_count ?? 0) > 0 && onOpenThread ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onOpenThread, style: styles19.threadPill, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles19.threadPillText, { color: theme.colors.brand }], children: [
3890
- "\u{1F4AC} ",
3891
- msg.reply_count,
3892
- " ",
3893
- msg.reply_count === 1 ? "reply" : "replies"
3894
- ] }) }) : null,
3895
- reactions ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles19.reactionsRow, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: /* @__PURE__ */ jsxRuntime.jsx(
3896
- ReactionStrip,
4499
+ renderSlot(
4500
+ slots?.thread,
4501
+ slotContext,
4502
+ threads && (msg.reply_count ?? 0) > 0 && onOpenThread ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: onOpenThread, style: styles20.threadPill, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles20.threadPillText, { color: theme.colors.accent }], children: [
4503
+ "\u{1F4AC} ",
4504
+ msg.reply_count,
4505
+ " ",
4506
+ msg.reply_count === 1 ? "reply" : "replies"
4507
+ ] }) }) : null
4508
+ ),
4509
+ renderSlot(
4510
+ slots?.reactions,
4511
+ slotContext,
4512
+ reactions ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles20.reactionsRow, { alignSelf: isSelf ? "flex-end" : "flex-start" }], children: /* @__PURE__ */ jsxRuntime.jsx(
4513
+ ReactionStrip,
4514
+ {
4515
+ messageId: msg.id,
4516
+ conversationId: msg.conversation_id,
4517
+ meId,
4518
+ ...msg.reactions ? { initialReactions: msg.reactions } : {}
4519
+ }
4520
+ ) }) : null
4521
+ )
4522
+ ] }),
4523
+ renderSlot(
4524
+ slots?.actions,
4525
+ slotContext,
4526
+ actions && actionsOpen ? /* @__PURE__ */ jsxRuntime.jsx(
4527
+ MessageActions,
3897
4528
  {
3898
- messageId: msg.id,
3899
- conversationId: msg.conversation_id,
3900
- meId,
3901
- ...msg.reactions ? { initialReactions: msg.reactions } : {}
4529
+ visible: actionsOpen,
4530
+ onClose: () => setActionsOpen(false),
4531
+ isSelf,
4532
+ ...reactions ? {
4533
+ // Inline quick-react row at the top of the sheet —
4534
+ // one tap = react + close, no second modal needed.
4535
+ onPickReaction: (emoji) => {
4536
+ void reactionsApi.addReaction(emoji);
4537
+ }
4538
+ } : {},
4539
+ ...msg.body && !msg.deleted_at ? {
4540
+ onCopy: () => {
4541
+ setActionsOpen(false);
4542
+ void Clipboard__namespace.setStringAsync(msg.body ?? "");
4543
+ }
4544
+ } : {},
4545
+ ...onStartEdit ? {
4546
+ onEdit: () => {
4547
+ setActionsOpen(false);
4548
+ onStartEdit();
4549
+ }
4550
+ } : {},
4551
+ ...onDelete ? {
4552
+ onDelete: () => {
4553
+ setActionsOpen(false);
4554
+ onDelete();
4555
+ }
4556
+ } : {},
4557
+ ...onOpenThread ? {
4558
+ onReplyInThread: () => {
4559
+ setActionsOpen(false);
4560
+ onOpenThread();
4561
+ }
4562
+ } : {},
4563
+ ...quotations && onQuote ? {
4564
+ onQuote: () => {
4565
+ setActionsOpen(false);
4566
+ onQuote();
4567
+ }
4568
+ } : {}
3902
4569
  }
3903
- ) }) : null
3904
- ] }),
3905
- actions && actionsOpen ? /* @__PURE__ */ jsxRuntime.jsx(
3906
- MessageActions,
3907
- {
3908
- visible: actionsOpen,
3909
- onClose: () => setActionsOpen(false),
3910
- isSelf,
3911
- ...reactions ? {
3912
- // Inline quick-react row at the top of the sheet —
3913
- // one tap = react + close, no second modal needed.
3914
- onPickReaction: (emoji) => {
3915
- void reactionsApi.addReaction(emoji);
3916
- }
3917
- } : {},
3918
- ...msg.body && !msg.deleted_at ? {
3919
- onCopy: () => {
3920
- setActionsOpen(false);
3921
- void Clipboard__namespace.setStringAsync(msg.body ?? "");
3922
- }
3923
- } : {},
3924
- ...onStartEdit ? {
3925
- onEdit: () => {
3926
- setActionsOpen(false);
3927
- onStartEdit();
3928
- }
3929
- } : {},
3930
- ...onDelete ? {
3931
- onDelete: () => {
3932
- setActionsOpen(false);
3933
- onDelete();
3934
- }
3935
- } : {},
3936
- ...onOpenThread ? {
3937
- onReplyInThread: () => {
3938
- setActionsOpen(false);
3939
- onOpenThread();
3940
- }
3941
- } : {},
3942
- ...quotations && onQuote ? {
3943
- onQuote: () => {
3944
- setActionsOpen(false);
3945
- onQuote();
3946
- }
3947
- } : {}
3948
- }
3949
- ) : null
4570
+ ) : null
4571
+ )
3950
4572
  ]
3951
4573
  }
3952
4574
  );
3953
4575
  }
3954
- var styles19 = reactNative.StyleSheet.create({
4576
+ var styles20 = reactNative.StyleSheet.create({
3955
4577
  row: {
3956
4578
  flexDirection: "row",
3957
4579
  alignItems: "flex-end",
@@ -3965,6 +4587,9 @@ var styles19 = reactNative.StyleSheet.create({
3965
4587
  paddingHorizontal: 10,
3966
4588
  maxWidth: "95%"
3967
4589
  },
4590
+ rowDense: {
4591
+ marginVertical: 0
4592
+ },
3968
4593
  rowEditing: {
3969
4594
  // Above ConversationView's editBackdrop (zIndex 5). Elevation
3970
4595
  // does the equivalent stacking on Android.
@@ -4017,7 +4642,9 @@ function ThreadView({
4017
4642
  conversationId,
4018
4643
  rootMessage,
4019
4644
  labelFor,
4020
- avatarFor
4645
+ avatarFor,
4646
+ layout,
4647
+ timeFormat
4021
4648
  }) {
4022
4649
  return /* @__PURE__ */ jsxRuntime.jsx(
4023
4650
  reactNative.Modal,
@@ -4034,7 +4661,9 @@ function ThreadView({
4034
4661
  conversationId,
4035
4662
  rootMessage,
4036
4663
  ...labelFor ? { labelFor } : {},
4037
- ...avatarFor ? { avatarFor } : {}
4664
+ ...avatarFor ? { avatarFor } : {},
4665
+ ...layout ? { layout } : {},
4666
+ ...timeFormat ? { timeFormat } : {}
4038
4667
  }
4039
4668
  ) })
4040
4669
  }
@@ -4045,9 +4674,11 @@ function ThreadSheet({
4045
4674
  conversationId,
4046
4675
  rootMessage,
4047
4676
  labelFor,
4048
- avatarFor
4677
+ avatarFor,
4678
+ layout,
4679
+ timeFormat
4049
4680
  }) {
4050
- const theme = usePoolseTheme();
4681
+ const theme = useTheme();
4051
4682
  const { me } = react$1.useMe();
4052
4683
  const meId = me?.id ?? null;
4053
4684
  const {
@@ -4090,11 +4721,13 @@ function ThreadSheet({
4090
4721
  void deleteReply(msg.id);
4091
4722
  },
4092
4723
  ...labelFor ? { labelFor } : {},
4093
- ...avatarFor ? { avatarFor } : {}
4724
+ ...avatarFor ? { avatarFor } : {},
4725
+ ...layout ? { layout } : {},
4726
+ ...timeFormat ? { timeFormat } : {}
4094
4727
  }
4095
4728
  );
4096
4729
  },
4097
- [meId, editingId, deleteReply, labelFor, avatarFor]
4730
+ [meId, editingId, deleteReply, labelFor, avatarFor, layout, timeFormat]
4098
4731
  );
4099
4732
  const editingMessage = react.useMemo(
4100
4733
  () => editingId ? replies.find((m) => m.id === editingId) ?? null : null,
@@ -4112,26 +4745,28 @@ function ThreadSheet({
4112
4745
  threads: false,
4113
4746
  quotations: false,
4114
4747
  ...labelFor ? { labelFor } : {},
4115
- ...avatarFor ? { avatarFor } : {}
4748
+ ...avatarFor ? { avatarFor } : {},
4749
+ ...layout ? { layout } : {},
4750
+ ...timeFormat ? { timeFormat } : {}
4116
4751
  }
4117
4752
  ),
4118
- [rootMessage, meId, labelFor, avatarFor]
4753
+ [rootMessage, meId, labelFor, avatarFor, layout, timeFormat]
4119
4754
  );
4120
4755
  return /* @__PURE__ */ jsxRuntime.jsxs(
4121
4756
  reactNative.View,
4122
4757
  {
4123
- style: styles20.modalRoot,
4758
+ style: styles21.modalRoot,
4124
4759
  onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
4125
4760
  children: [
4126
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles20.backdrop, onPress: onClose, accessibilityLabel: "Close thread" }),
4761
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles21.backdrop, onPress: onClose, accessibilityLabel: "Close thread" }),
4127
4762
  /* @__PURE__ */ jsxRuntime.jsxs(
4128
4763
  reactNative.Animated.View,
4129
4764
  {
4130
4765
  style: [
4131
- styles20.sheet,
4766
+ styles21.sheet,
4132
4767
  {
4133
4768
  height: sheetHeight,
4134
- backgroundColor: theme.colors.paper,
4769
+ backgroundColor: theme.colors.background,
4135
4770
  borderTopLeftRadius: theme.radii.xl,
4136
4771
  borderTopRightRadius: theme.radii.xl,
4137
4772
  paddingLeft: insets.left,
@@ -4142,25 +4777,22 @@ function ThreadSheet({
4142
4777
  ],
4143
4778
  children: [
4144
4779
  /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ...panHandlers, children: [
4145
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles20.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles20.dragPill, { backgroundColor: theme.colors.ink3 }] }) }),
4146
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles20.header, { borderBottomColor: theme.colors.border }], children: [
4780
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles21.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles21.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
4781
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles21.header, { borderBottomColor: theme.colors.border }], children: [
4147
4782
  /* @__PURE__ */ jsxRuntime.jsx(
4148
4783
  reactNative.Pressable,
4149
4784
  {
4150
4785
  onPress: onClose,
4151
4786
  hitSlop: 16,
4152
- style: [styles20.closeBtn, { backgroundColor: theme.colors.surface2 }],
4787
+ style: [styles21.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
4153
4788
  accessibilityLabel: "Close thread",
4154
- children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.ink })
4789
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
4155
4790
  }
4156
4791
  ),
4157
4792
  /* @__PURE__ */ jsxRuntime.jsx(
4158
4793
  reactNative.Text,
4159
4794
  {
4160
- style: [
4161
- styles20.title,
4162
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
4163
- ],
4795
+ style: [styles21.title, { color: theme.colors.text, fontFamily: theme.fonts.display }],
4164
4796
  children: "Thread"
4165
4797
  }
4166
4798
  )
@@ -4169,12 +4801,12 @@ function ThreadSheet({
4169
4801
  /* @__PURE__ */ jsxRuntime.jsxs(
4170
4802
  reactNative.KeyboardAvoidingView,
4171
4803
  {
4172
- style: styles20.kavBody,
4804
+ style: styles21.kavBody,
4173
4805
  behavior: "padding",
4174
4806
  keyboardVerticalOffset: gutter,
4175
4807
  children: [
4176
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles20.rootPreview, { backgroundColor: theme.colors.surface2 }], children: rootRow }),
4177
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles20.listWrap, children: /* @__PURE__ */ jsxRuntime.jsx(
4808
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles21.rootPreview, { backgroundColor: theme.colors.surfaceAlt }], children: rootRow }),
4809
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles21.listWrap, children: /* @__PURE__ */ jsxRuntime.jsx(
4178
4810
  MessageList,
4179
4811
  {
4180
4812
  messages: replies,
@@ -4212,7 +4844,7 @@ function ThreadSheet({
4212
4844
  }
4213
4845
  );
4214
4846
  }
4215
- var styles20 = reactNative.StyleSheet.create({
4847
+ var styles21 = reactNative.StyleSheet.create({
4216
4848
  modalRoot: {
4217
4849
  flex: 1,
4218
4850
  justifyContent: "flex-end"
@@ -4267,9 +4899,9 @@ var styles20 = reactNative.StyleSheet.create({
4267
4899
  }
4268
4900
  });
4269
4901
  function UserName({ externalId, fallback, labelFor }) {
4270
- const theme = usePoolseTheme();
4902
+ const theme = useTheme();
4271
4903
  const name = useDisplayName(externalId, labelFor) ?? fallback ?? externalId ?? "";
4272
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.ink, fontFamily: theme.type.fontBody }, children: name });
4904
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.colors.text, fontFamily: theme.fonts.body }, children: name });
4273
4905
  }
4274
4906
  function useDisplayName(externalId, labelFor) {
4275
4907
  const resolved = react$1.useUser(externalId ?? null);
@@ -4284,13 +4916,13 @@ function TypingIndicator({ typing, labelFor }) {
4284
4916
  const ids = Array.from(typing);
4285
4917
  const isTyping = ids.length > 0;
4286
4918
  if (!isTyping) return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { height: 0 } });
4287
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles21.row, children: [
4919
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles22.row, children: [
4288
4920
  /* @__PURE__ */ jsxRuntime.jsx(TypingDots, {}),
4289
4921
  /* @__PURE__ */ jsxRuntime.jsx(TypingLabel, { ids, ...labelFor ? { labelFor } : {} })
4290
4922
  ] });
4291
4923
  }
4292
4924
  function TypingDots() {
4293
- const theme = usePoolseTheme();
4925
+ const theme = useTheme();
4294
4926
  const a = react.useRef(new reactNative.Animated.Value(0)).current;
4295
4927
  const b = react.useRef(new reactNative.Animated.Value(0)).current;
4296
4928
  const c = react.useRef(new reactNative.Animated.Value(0)).current;
@@ -4320,7 +4952,7 @@ function TypingDots() {
4320
4952
  width: 6,
4321
4953
  height: 6,
4322
4954
  borderRadius: 3,
4323
- backgroundColor: theme.colors.ink3,
4955
+ backgroundColor: theme.colors.textSubtle,
4324
4956
  marginHorizontal: 2,
4325
4957
  transform: [
4326
4958
  {
@@ -4329,7 +4961,7 @@ function TypingDots() {
4329
4961
  ],
4330
4962
  opacity: val.interpolate({ inputRange: [0, 1], outputRange: [0.5, 1] })
4331
4963
  });
4332
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles21.dotsWrap, children: [
4964
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles22.dotsWrap, children: [
4333
4965
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(a) }),
4334
4966
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(b) }),
4335
4967
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: dot(c) })
@@ -4339,15 +4971,15 @@ function TypingLabel({
4339
4971
  ids,
4340
4972
  labelFor
4341
4973
  }) {
4342
- const theme = usePoolseTheme();
4974
+ const theme = useTheme();
4343
4975
  const id1 = ids[0] ?? null;
4344
4976
  const id2 = ids[1] ?? null;
4345
4977
  const name1 = useDisplayName(id1, labelFor);
4346
4978
  const name2 = useDisplayName(id2, labelFor);
4347
4979
  const text = ids.length === 1 ? `${name1} is typing` : ids.length === 2 ? `${name1} and ${name2} are typing` : `${ids.length} people are typing`;
4348
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.label, { color: theme.colors.ink2, fontFamily: theme.type.fontBody }], children: text });
4980
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles22.label, { color: theme.colors.textMuted, fontFamily: theme.fonts.body }], children: text });
4349
4981
  }
4350
- var styles21 = reactNative.StyleSheet.create({
4982
+ var styles22 = reactNative.StyleSheet.create({
4351
4983
  row: {
4352
4984
  flexDirection: "row",
4353
4985
  alignItems: "center",
@@ -4364,7 +4996,7 @@ var styles21 = reactNative.StyleSheet.create({
4364
4996
  fontSize: 12
4365
4997
  }
4366
4998
  });
4367
- var GROUPING_WINDOW_MS = 5 * 60 * 1e3;
4999
+ var GROUP_WINDOW_MINUTES = 5;
4368
5000
  function ConversationView({
4369
5001
  conversationId,
4370
5002
  emptyState,
@@ -4396,9 +5028,16 @@ function ConversationView({
4396
5028
  keyboardOffset = 0,
4397
5029
  onCallBack,
4398
5030
  onJoinCall,
4399
- currentCallId = null
5031
+ currentCallId = null,
5032
+ layout = "bubbles",
5033
+ density = "comfortable",
5034
+ showAvatars: showAvatarsProp,
5035
+ timeFormat,
5036
+ groupWindowMinutes = GROUP_WINDOW_MINUTES,
5037
+ daySeparators = true,
5038
+ slots
4400
5039
  }) {
4401
- const theme = usePoolseTheme();
5040
+ const theme = useTheme();
4402
5041
  const showComposer = composer && !readOnly;
4403
5042
  const canQuote = quotations && showComposer;
4404
5043
  const canAttach = attachments && showComposer;
@@ -4447,7 +5086,16 @@ function ConversationView({
4447
5086
  const { members } = react$1.useMembers(wantsMembers ? conversationId : "");
4448
5087
  const isGroupChat = members.length > 2;
4449
5088
  const showSenderLabels = senderLabels === "always" || senderLabels === "auto" && isGroupChat;
4450
- const showAvatars = avatars === "always" || avatars === "auto" && isGroupChat;
5089
+ const showAvatars = showAvatarsProp ?? (layout === "list" ? true : layout === "compact" ? false : avatars === "always" || avatars === "auto" && isGroupChat);
5090
+ const layoutProps = react.useMemo(
5091
+ () => ({
5092
+ layout,
5093
+ density,
5094
+ ...timeFormat ? { timeFormat } : {},
5095
+ ...slots ? { slots } : {}
5096
+ }),
5097
+ [layout, density, timeFormat, slots]
5098
+ );
4451
5099
  const [replyingTo, setReplyingTo] = react.useState(null);
4452
5100
  const [editingId, setEditingId] = react.useState(null);
4453
5101
  const [threadRoot, setThreadRoot] = react.useState(null);
@@ -4535,16 +5183,12 @@ function ConversationView({
4535
5183
  if (!msg) continue;
4536
5184
  const prev = i > 0 ? visibleMessages[i - 1] ?? null : null;
4537
5185
  const next = i < visibleMessages.length - 1 ? visibleMessages[i + 1] ?? null : null;
4538
- map.set(msg.id, react$1.computeGroupPosition(msg, prev, next, GROUPING_WINDOW_MS));
5186
+ map.set(msg.id, react$1.computeGroupPosition(msg, prev, next, groupWindowMinutes * 60 * 1e3));
4539
5187
  }
4540
5188
  return map;
4541
- }, [visibleMessages]);
4542
- const renderItem = react.useCallback(
4543
- (msg) => {
4544
- if (renderMessage) {
4545
- const custom = renderMessage(msg, meId);
4546
- if (custom !== null && custom !== void 0) return custom;
4547
- }
5189
+ }, [visibleMessages, groupWindowMinutes]);
5190
+ const defaultRow = react.useCallback(
5191
+ (msg, groupPosition) => {
4548
5192
  const readState = showReadState && meId !== null && msg.sender_id === meId ? readStateForMessage(msg, members, meId, sequenceByMessageId) : void 0;
4549
5193
  const isSelf = meId !== null && msg.sender_id === meId;
4550
5194
  const canEdit = react$1.canEditOwnMessage({
@@ -4554,7 +5198,6 @@ function ConversationView({
4554
5198
  readState,
4555
5199
  insertedAt: msg.inserted_at
4556
5200
  });
4557
- const groupPosition = groupPositionById.get(msg.id) ?? "standalone";
4558
5201
  const row = /* @__PURE__ */ jsxRuntime.jsx(
4559
5202
  MessageRow,
4560
5203
  {
@@ -4581,11 +5224,13 @@ function ConversationView({
4581
5224
  maxBodyLength,
4582
5225
  groupPosition,
4583
5226
  markdown,
4584
- ...onCallBack ? { onCallBack } : {}
5227
+ ...onCallBack ? { onCallBack } : {},
5228
+ ...layoutProps,
5229
+ mentionsMe: mentionsViewer(msg, meId)
4585
5230
  }
4586
5231
  );
4587
5232
  if (msg.id !== highlightId) return row;
4588
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { backgroundColor: theme.colors.brandSoft }, children: row });
5233
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { backgroundColor: theme.colors.accentSoft }, children: row });
4589
5234
  },
4590
5235
  [
4591
5236
  onCallBack,
@@ -4593,9 +5238,8 @@ function ConversationView({
4593
5238
  onSenderPress,
4594
5239
  onAvatarPress,
4595
5240
  highlightId,
4596
- theme.colors.brandSoft,
5241
+ theme.colors.accentSoft,
4597
5242
  canQuote,
4598
- renderMessage,
4599
5243
  meId,
4600
5244
  showReadState,
4601
5245
  receiptsVisible,
@@ -4612,10 +5256,26 @@ function ConversationView({
4612
5256
  showAvatars,
4613
5257
  maxBodyLength,
4614
5258
  sequenceByMessageId,
4615
- groupPositionById,
4616
- markdown
5259
+ markdown,
5260
+ layoutProps
4617
5261
  ]
4618
5262
  );
5263
+ const renderItem = react.useCallback(
5264
+ (msg) => {
5265
+ const groupPosition = groupPositionById.get(msg.id) ?? "standalone";
5266
+ if (renderMessage) {
5267
+ const custom = renderMessage(msg, meId, {
5268
+ layout,
5269
+ groupPosition,
5270
+ isRunStart: layout === "compact" || groupPosition === "first" || groupPosition === "standalone",
5271
+ renderDefault: () => defaultRow(msg, groupPosition)
5272
+ });
5273
+ if (custom !== null && custom !== void 0) return custom;
5274
+ }
5275
+ return defaultRow(msg, groupPosition);
5276
+ },
5277
+ [renderMessage, meId, layout, groupPositionById, defaultRow]
5278
+ );
4619
5279
  const editingMessage = react.useMemo(
4620
5280
  () => editingId ? messages.find((m) => m.id === editingId) ?? null : null,
4621
5281
  [editingId, messages]
@@ -4624,19 +5284,19 @@ function ConversationView({
4624
5284
  const out = [];
4625
5285
  let prev = null;
4626
5286
  for (const msg of visibleMessages) {
4627
- if (prev === null || !react$1.sameDay(msg.inserted_at, prev.inserted_at)) {
5287
+ if (daySeparators && (prev === null || !react$1.sameDay(msg.inserted_at, prev.inserted_at))) {
4628
5288
  const label = react$1.formatDayLabel(msg.inserted_at);
4629
5289
  out.push({
4630
5290
  kind: "separator",
4631
5291
  id: `sep-${msg.id}`,
4632
- node: /* @__PURE__ */ jsxRuntime.jsx(DaySeparator, { label })
5292
+ node: /* @__PURE__ */ jsxRuntime.jsx(DaySeparator, { label, variant: layout === "bubbles" ? "pill" : "rule" })
4633
5293
  });
4634
5294
  }
4635
5295
  out.push({ kind: "msg", msg });
4636
5296
  prev = msg;
4637
5297
  }
4638
5298
  return out;
4639
- }, [visibleMessages]);
5299
+ }, [visibleMessages, daySeparators, layout]);
4640
5300
  const composerProps = react.useMemo(
4641
5301
  () => ({
4642
5302
  onSend: async (body, opts) => {
@@ -4686,7 +5346,7 @@ function ConversationView({
4686
5346
  return /* @__PURE__ */ jsxRuntime.jsx(UploadProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
4687
5347
  reactNative.KeyboardAvoidingView,
4688
5348
  {
4689
- style: [styles22.root, { backgroundColor: theme.colors.paper }],
5349
+ style: [styles23.root, { backgroundColor: theme.colors.background }],
4690
5350
  behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
4691
5351
  keyboardVerticalOffset: keyboardOffset,
4692
5352
  children: [
@@ -4695,8 +5355,8 @@ function ConversationView({
4695
5355
  reactNative.Text,
4696
5356
  {
4697
5357
  style: [
4698
- styles22.notice,
4699
- { color: theme.colors.ink2, backgroundColor: theme.colors.surface2 }
5358
+ styles23.notice,
5359
+ { color: theme.colors.textMuted, backgroundColor: theme.colors.surfaceAlt }
4700
5360
  ],
4701
5361
  accessibilityRole: "alert",
4702
5362
  children: "That message isn't available."
@@ -4711,7 +5371,7 @@ function ConversationView({
4711
5371
  onJoin: onJoinCall
4712
5372
  }
4713
5373
  ) : null,
4714
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles22.listWrap, children: [
5374
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles23.listWrap, children: [
4715
5375
  /* @__PURE__ */ jsxRuntime.jsx(
4716
5376
  MessageList,
4717
5377
  {
@@ -4729,7 +5389,7 @@ function ConversationView({
4729
5389
  (stream) => stream.status === "failed" ? /* @__PURE__ */ jsxRuntime.jsx(
4730
5390
  reactNative.Text,
4731
5391
  {
4732
- style: [styles22.streamFailed, { color: theme.colors.ink3 }],
5392
+ style: [styles23.streamFailed, { color: theme.colors.textSubtle }],
4733
5393
  accessibilityRole: "alert",
4734
5394
  children: stream.error ? `The agent couldn't reply: ${stream.error}` : "The agent couldn't reply."
4735
5395
  },
@@ -4748,7 +5408,8 @@ function ConversationView({
4748
5408
  ...avatarFor ? { avatarFor } : {},
4749
5409
  showSenderName: showSenderLabels,
4750
5410
  showAvatar: showAvatars,
4751
- markdown
5411
+ markdown,
5412
+ ...layoutProps
4752
5413
  },
4753
5414
  stream.id
4754
5415
  )
@@ -4761,7 +5422,7 @@ function ConversationView({
4761
5422
  editingId ? /* @__PURE__ */ jsxRuntime.jsx(
4762
5423
  reactNative.Pressable,
4763
5424
  {
4764
- style: styles22.editBackdrop,
5425
+ style: [styles23.editBackdrop, { backgroundColor: theme.colors.overlay }],
4765
5426
  onPress: () => setEditingId(null),
4766
5427
  accessibilityLabel: "Cancel editing"
4767
5428
  }
@@ -4776,7 +5437,9 @@ function ConversationView({
4776
5437
  onClose: () => setThreadRoot(null),
4777
5438
  conversationId,
4778
5439
  rootMessage: threadRoot,
4779
- ...labelFor ? { labelFor } : {}
5440
+ ...labelFor ? { labelFor } : {},
5441
+ layout,
5442
+ ...timeFormat ? { timeFormat } : {}
4780
5443
  }
4781
5444
  ) : null
4782
5445
  ]
@@ -4807,7 +5470,7 @@ function readStateForMessage(msg, members, meId, sequenceByMessageId) {
4807
5470
  });
4808
5471
  return anyRead ? "read" : "sent";
4809
5472
  }
4810
- var styles22 = reactNative.StyleSheet.create({
5473
+ var styles23 = reactNative.StyleSheet.create({
4811
5474
  root: {
4812
5475
  flex: 1
4813
5476
  },
@@ -4827,7 +5490,6 @@ var styles22 = reactNative.StyleSheet.create({
4827
5490
  },
4828
5491
  editBackdrop: {
4829
5492
  ...reactNative.StyleSheet.absoluteFillObject,
4830
- backgroundColor: "rgba(0,0,0,0.45)",
4831
5493
  // Sit above message rows by default but below any row that
4832
5494
  // explicitly elevates itself (MessageRow bumps zIndex/elevation
4833
5495
  // when isEditing is true).
@@ -4866,7 +5528,7 @@ function UserPickerSheet({
4866
5528
  title,
4867
5529
  searchable
4868
5530
  }) {
4869
- const theme = usePoolseTheme();
5531
+ const theme = useTheme();
4870
5532
  const [query, setQuery] = react.useState("");
4871
5533
  const [selectedIds, setSelectedIds] = react.useState([]);
4872
5534
  const [groupName, setGroupName] = react.useState("");
@@ -4929,17 +5591,17 @@ function UserPickerSheet({
4929
5591
  children: /* @__PURE__ */ jsxRuntime.jsxs(
4930
5592
  reactNative.View,
4931
5593
  {
4932
- style: styles23.modalRoot,
5594
+ style: styles24.modalRoot,
4933
5595
  onLayout: (e) => setRootHeight(Math.round(e.nativeEvent.layout.height)),
4934
5596
  children: [
4935
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles23.backdrop, onPress: handleClose }),
5597
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles24.backdrop, onPress: handleClose }),
4936
5598
  /* @__PURE__ */ jsxRuntime.jsx(
4937
5599
  reactNative.Animated.View,
4938
5600
  {
4939
5601
  style: [
4940
- styles23.sheet,
5602
+ styles24.sheet,
4941
5603
  {
4942
- backgroundColor: theme.colors.paper,
5604
+ backgroundColor: theme.colors.background,
4943
5605
  borderTopLeftRadius: theme.radii.xl,
4944
5606
  borderTopRightRadius: theme.radii.xl,
4945
5607
  height: sheetHeight,
@@ -4955,28 +5617,28 @@ function UserPickerSheet({
4955
5617
  children: /* @__PURE__ */ jsxRuntime.jsxs(
4956
5618
  reactNative.KeyboardAvoidingView,
4957
5619
  {
4958
- style: styles23.kav,
5620
+ style: styles24.kav,
4959
5621
  behavior: "padding",
4960
5622
  keyboardVerticalOffset: screenHeight - sheetHeight,
4961
5623
  children: [
4962
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...panHandlers, style: styles23.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles23.dragPill, { backgroundColor: theme.colors.ink3 }] }) }),
4963
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles23.header, children: [
5624
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...panHandlers, style: styles24.dragHandle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles24.dragPill, { backgroundColor: theme.colors.textSubtle }] }) }),
5625
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles24.header, children: [
4964
5626
  /* @__PURE__ */ jsxRuntime.jsx(
4965
5627
  reactNative.Pressable,
4966
5628
  {
4967
5629
  onPress: handleClose,
4968
5630
  hitSlop: 16,
4969
- style: [styles23.closeBtn, { backgroundColor: theme.colors.surface2 }],
5631
+ style: [styles24.closeBtn, { backgroundColor: theme.colors.surfaceAlt }],
4970
5632
  accessibilityLabel: "Close picker",
4971
- children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.ink })
5633
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "close", size: 18, color: theme.colors.text })
4972
5634
  }
4973
5635
  ),
4974
5636
  /* @__PURE__ */ jsxRuntime.jsx(
4975
5637
  reactNative.Text,
4976
5638
  {
4977
5639
  style: [
4978
- styles23.title,
4979
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
5640
+ styles24.title,
5641
+ { color: theme.colors.text, fontFamily: theme.fonts.display }
4980
5642
  ],
4981
5643
  numberOfLines: 1,
4982
5644
  children: heading
@@ -4989,9 +5651,9 @@ function UserPickerSheet({
4989
5651
  disabled: !canCreate,
4990
5652
  hitSlop: 6,
4991
5653
  style: [
4992
- styles23.createBtn,
5654
+ styles24.createBtn,
4993
5655
  {
4994
- backgroundColor: canCreate ? theme.colors.brand : theme.colors.surface2,
5656
+ backgroundColor: canCreate ? theme.colors.accent : theme.colors.surfaceAlt,
4995
5657
  opacity: canCreate ? 1 : 0.6
4996
5658
  }
4997
5659
  ],
@@ -4999,7 +5661,7 @@ function UserPickerSheet({
4999
5661
  reactNative.Text,
5000
5662
  {
5001
5663
  style: {
5002
- color: canCreate ? theme.colors.onBrand : theme.colors.ink3,
5664
+ color: canCreate ? theme.colors.accentText : theme.colors.textSubtle,
5003
5665
  fontWeight: "700",
5004
5666
  fontSize: 13
5005
5667
  },
@@ -5016,17 +5678,17 @@ function UserPickerSheet({
5016
5678
  reactNative.TextInput,
5017
5679
  {
5018
5680
  placeholder: "Group name",
5019
- placeholderTextColor: theme.colors.ink3,
5681
+ placeholderTextColor: theme.colors.textSubtle,
5020
5682
  value: groupName,
5021
5683
  onChangeText: setGroupName,
5022
5684
  style: [
5023
- styles23.groupNameInput,
5685
+ styles24.groupNameInput,
5024
5686
  {
5025
- color: theme.colors.ink,
5026
- backgroundColor: theme.colors.surface2,
5687
+ color: theme.colors.text,
5688
+ backgroundColor: theme.colors.surfaceAlt,
5027
5689
  borderRadius: theme.radii.md,
5028
- fontFamily: theme.type.fontBody,
5029
- fontSize: theme.type.bodySize
5690
+ fontFamily: theme.fonts.body,
5691
+ fontSize: theme.fonts.sizeMd
5030
5692
  }
5031
5693
  ]
5032
5694
  }
@@ -5035,16 +5697,16 @@ function UserPickerSheet({
5035
5697
  reactNative.TextInput,
5036
5698
  {
5037
5699
  placeholder: "Search\u2026",
5038
- placeholderTextColor: theme.colors.ink3,
5700
+ placeholderTextColor: theme.colors.textSubtle,
5039
5701
  value: query,
5040
5702
  onChangeText: setQuery,
5041
5703
  style: [
5042
- styles23.searchInput,
5704
+ styles24.searchInput,
5043
5705
  {
5044
- color: theme.colors.ink,
5045
- backgroundColor: theme.colors.surface2,
5706
+ color: theme.colors.text,
5707
+ backgroundColor: theme.colors.surfaceAlt,
5046
5708
  borderRadius: theme.radii.md,
5047
- fontFamily: theme.type.fontBody,
5709
+ fontFamily: theme.fonts.body,
5048
5710
  fontSize: 14
5049
5711
  }
5050
5712
  ]
@@ -5056,7 +5718,7 @@ function UserPickerSheet({
5056
5718
  data: filtered,
5057
5719
  keyExtractor: (u) => u.externalId,
5058
5720
  keyboardShouldPersistTaps: "handled",
5059
- ListEmptyComponent: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles23.empty, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles23.emptyText, { color: theme.colors.ink3 }], children: query ? "No matches." : "No users to show." }) }),
5721
+ ListEmptyComponent: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles24.empty, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles24.emptyText, { color: theme.colors.textSubtle }], children: query ? "No matches." : "No users to show." }) }),
5060
5722
  renderItem: ({ item }) => /* @__PURE__ */ jsxRuntime.jsx(
5061
5723
  UserRow,
5062
5724
  {
@@ -5092,48 +5754,48 @@ function UserRow({
5092
5754
  isGroup,
5093
5755
  onPress
5094
5756
  }) {
5095
- const theme = usePoolseTheme();
5757
+ const theme = useTheme();
5096
5758
  return /* @__PURE__ */ jsxRuntime.jsxs(
5097
5759
  reactNative.Pressable,
5098
5760
  {
5099
5761
  onPress,
5100
5762
  style: [
5101
- styles23.row,
5763
+ styles24.row,
5102
5764
  {
5103
- backgroundColor: selected ? theme.colors.brandSoft : "transparent"
5765
+ backgroundColor: selected ? theme.colors.accentSoft : "transparent"
5104
5766
  }
5105
5767
  ],
5106
5768
  children: [
5107
- user.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { source: { uri: user.avatarUrl }, style: styles23.avatarImg }) : /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: null, name: user.name, seed: user.externalId, size: "md" }),
5108
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles23.body, children: [
5769
+ user.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { source: { uri: user.avatarUrl }, style: styles24.avatarImg }) : /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: null, name: user.name, seed: user.externalId, size: "md" }),
5770
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles24.body, children: [
5109
5771
  /* @__PURE__ */ jsxRuntime.jsx(
5110
5772
  reactNative.Text,
5111
5773
  {
5112
- style: [styles23.name, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
5774
+ style: [styles24.name, { color: theme.colors.text, fontFamily: theme.fonts.body }],
5113
5775
  numberOfLines: 1,
5114
5776
  children: user.name
5115
5777
  }
5116
5778
  ),
5117
- user.subtitle ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles23.subtitle, { color: theme.colors.ink3 }], numberOfLines: 1, children: user.subtitle }) : null
5779
+ user.subtitle ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles24.subtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: user.subtitle }) : null
5118
5780
  ] }),
5119
5781
  isGroup ? /* @__PURE__ */ jsxRuntime.jsx(
5120
5782
  reactNative.View,
5121
5783
  {
5122
5784
  style: [
5123
- styles23.checkbox,
5785
+ styles24.checkbox,
5124
5786
  {
5125
- borderColor: selected ? theme.colors.brand : theme.colors.border,
5126
- backgroundColor: selected ? theme.colors.brand : "transparent"
5787
+ borderColor: selected ? theme.colors.accent : theme.colors.border,
5788
+ backgroundColor: selected ? theme.colors.accent : "transparent"
5127
5789
  }
5128
5790
  ],
5129
- children: selected ? /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "check", size: 14, color: theme.colors.onBrand }) : null
5791
+ children: selected ? /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "check", size: 14, color: theme.colors.accentText }) : null
5130
5792
  }
5131
5793
  ) : null
5132
5794
  ]
5133
5795
  }
5134
5796
  );
5135
5797
  }
5136
- var styles23 = reactNative.StyleSheet.create({
5798
+ var styles24 = reactNative.StyleSheet.create({
5137
5799
  modalRoot: {
5138
5800
  flex: 1,
5139
5801
  justifyContent: "flex-end"
@@ -5249,7 +5911,7 @@ var PoolseInbox = react.forwardRef(
5249
5911
  emptyState,
5250
5912
  keyboardOffset = 0
5251
5913
  } = props;
5252
- const theme = usePoolseTheme();
5914
+ const theme = useTheme();
5253
5915
  const { width: screenWidth } = reactNative.useWindowDimensions();
5254
5916
  const { me } = react$1.useMe();
5255
5917
  const {
@@ -5397,7 +6059,7 @@ var PoolseInbox = react.forwardRef(
5397
6059
  },
5398
6060
  [renderConversationRow, meExternalId, meId, labelFor, avatarFor, unreadCounts]
5399
6061
  );
5400
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles24.root, { backgroundColor: theme.colors.paper }], children: [
6062
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles25.root, { backgroundColor: theme.colors.background }], children: [
5401
6063
  /* @__PURE__ */ jsxRuntime.jsxs(
5402
6064
  reactNative.Animated.View,
5403
6065
  {
@@ -5408,7 +6070,7 @@ var PoolseInbox = react.forwardRef(
5408
6070
  reactNative.View,
5409
6071
  {
5410
6072
  style: [
5411
- styles24.listHeader,
6073
+ styles25.listHeader,
5412
6074
  {
5413
6075
  backgroundColor: theme.colors.surface,
5414
6076
  borderBottomColor: theme.colors.border
@@ -5419,13 +6081,13 @@ var PoolseInbox = react.forwardRef(
5419
6081
  reactNative.Text,
5420
6082
  {
5421
6083
  style: [
5422
- styles24.listTitle,
5423
- { color: theme.colors.ink, fontFamily: theme.type.fontDisplay }
6084
+ styles25.listTitle,
6085
+ { color: theme.colors.text, fontFamily: theme.fonts.display }
5424
6086
  ],
5425
6087
  children: title
5426
6088
  }
5427
6089
  ),
5428
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles24.headerActions, children: [
6090
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles25.headerActions, children: [
5429
6091
  users ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5430
6092
  /* @__PURE__ */ jsxRuntime.jsx(
5431
6093
  HeaderIconButton,
@@ -5530,7 +6192,7 @@ function HeaderIconButton({
5530
6192
  onPress,
5531
6193
  label
5532
6194
  }) {
5533
- const theme = usePoolseTheme();
6195
+ const theme = useTheme();
5534
6196
  return /* @__PURE__ */ jsxRuntime.jsx(
5535
6197
  reactNative.Pressable,
5536
6198
  {
@@ -5538,12 +6200,12 @@ function HeaderIconButton({
5538
6200
  hitSlop: 10,
5539
6201
  accessibilityLabel: label,
5540
6202
  style: ({ pressed }) => [
5541
- styles24.iconBtn,
6203
+ styles25.iconBtn,
5542
6204
  {
5543
- backgroundColor: pressed ? theme.colors.surface2 : "transparent"
6205
+ backgroundColor: pressed ? theme.colors.surfaceAlt : "transparent"
5544
6206
  }
5545
6207
  ],
5546
- children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: icon, size: 20, color: theme.colors.ink })
6208
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: icon, size: 20, color: theme.colors.text })
5547
6209
  }
5548
6210
  );
5549
6211
  }
@@ -5557,7 +6219,7 @@ function DefaultConversationRow({
5557
6219
  avatarFor,
5558
6220
  onPress
5559
6221
  }) {
5560
- const theme = usePoolseTheme();
6222
+ const theme = useTheme();
5561
6223
  const isDirect = conv.type === "direct";
5562
6224
  const otherExtId = isDirect && meExternalId ? (conv.member_external_ids ?? []).find((x) => x !== meExternalId) : null;
5563
6225
  const resolvedOther = react$1.useUser(isDirect ? otherExtId ?? null : null);
@@ -5569,31 +6231,31 @@ function DefaultConversationRow({
5569
6231
  {
5570
6232
  onPress,
5571
6233
  style: [
5572
- styles24.row,
6234
+ styles25.row,
5573
6235
  {
5574
- backgroundColor: selected ? theme.colors.surface2 : "transparent",
6236
+ backgroundColor: selected ? theme.colors.surfaceAlt : "transparent",
5575
6237
  borderBottomColor: theme.colors.border
5576
6238
  }
5577
6239
  ],
5578
6240
  children: [
5579
- avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { source: { uri: avatarUrl }, style: styles24.rowAvatar }) : /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: null, name: title, seed: avatarSeed, size: "md" }),
5580
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles24.rowBody, children: [
6241
+ avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { source: { uri: avatarUrl }, style: styles25.rowAvatar }) : /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: null, name: title, seed: avatarSeed, size: "md" }),
6242
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles25.rowBody, children: [
5581
6243
  /* @__PURE__ */ jsxRuntime.jsx(
5582
6244
  reactNative.Text,
5583
6245
  {
5584
- style: [styles24.rowTitle, { color: theme.colors.ink, fontFamily: theme.type.fontBody }],
6246
+ style: [styles25.rowTitle, { color: theme.colors.text, fontFamily: theme.fonts.body }],
5585
6247
  numberOfLines: 1,
5586
6248
  children: title
5587
6249
  }
5588
6250
  ),
5589
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles24.rowSubtitle, { color: theme.colors.ink3 }], numberOfLines: 1, children: react$1.formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview ?? (isDirect ? otherExtId ?? "" : `${(conv.member_external_ids ?? []).length} members`) })
6251
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles25.rowSubtitle, { color: theme.colors.textSubtle }], numberOfLines: 1, children: react$1.formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview ?? (isDirect ? otherExtId ?? "" : `${(conv.member_external_ids ?? []).length} members`) })
5590
6252
  ] }),
5591
- unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles24.unreadPill, { backgroundColor: theme.colors.unreadPill }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles24.unreadText, { color: theme.colors.unreadPillText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
6253
+ unread > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles25.unreadPill, { backgroundColor: theme.colors.badge }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles25.unreadText, { color: theme.colors.badgeText }], children: unread > 99 ? "99+" : String(unread) }) }) : null
5592
6254
  ]
5593
6255
  }
5594
6256
  );
5595
6257
  }
5596
- var styles24 = reactNative.StyleSheet.create({
6258
+ var styles25 = reactNative.StyleSheet.create({
5597
6259
  root: {
5598
6260
  flex: 1,
5599
6261
  overflow: "hidden"
@@ -5674,16 +6336,16 @@ var VARIANT_VB = {
5674
6336
  mono: { vb: [0, 0, 454, 100], aspect: 4.54 }
5675
6337
  };
5676
6338
  function PoolseLogo({ variant = "lockup", size = 28, color, label }) {
5677
- const theme = usePoolseTheme();
6339
+ const theme = useTheme();
5678
6340
  const mono = variant === "mono";
5679
- const monoColor = color ?? theme.colors.ink;
5680
- const tileFill = mono ? "none" : theme.colors.brand;
6341
+ const monoColor = color ?? theme.colors.text;
6342
+ const tileFill = mono ? "none" : theme.colors.accent;
5681
6343
  const tileStroke = mono ? monoColor : "transparent";
5682
6344
  const tileStrokeWidth = mono ? 5 : 0;
5683
- const pulseStroke = mono ? monoColor : theme.colors.onBrand;
5684
- const pulseDotFill = mono ? monoColor : theme.colors.onBrand;
5685
- const inkFill = mono ? monoColor : theme.colors.ink;
5686
- const oFill = mono ? monoColor : theme.colors.brand;
6345
+ const pulseStroke = mono ? monoColor : theme.colors.accentText;
6346
+ const pulseDotFill = mono ? monoColor : theme.colors.accentText;
6347
+ const inkFill = mono ? monoColor : theme.colors.text;
6348
+ const oFill = mono ? monoColor : theme.colors.accent;
5687
6349
  const { vb, aspect } = VARIANT_VB[variant];
5688
6350
  const width = size * aspect;
5689
6351
  const showMark = variant === "lockup" || variant === "mark" || variant === "mono";
@@ -5778,7 +6440,7 @@ function CallControlButton({
5778
6440
  const size = large ? CONTROL_SIZE_LARGE : CONTROL_SIZE;
5779
6441
  const background = tone === "danger" ? callColors.danger : tone === "accept" ? callColors.accept : active ? callColors.controlActive : callColors.control;
5780
6442
  const iconColor = tone === "neutral" && active ? callColors.controlActiveIcon : callColors.onAction;
5781
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles25.slot, children: [
6443
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles26.slot, children: [
5782
6444
  /* @__PURE__ */ jsxRuntime.jsx(
5783
6445
  reactNative.Pressable,
5784
6446
  {
@@ -5789,7 +6451,7 @@ function CallControlButton({
5789
6451
  accessibilityLabel: accessibilityLabel ?? label ?? icon,
5790
6452
  hitSlop: 8,
5791
6453
  style: ({ pressed }) => [
5792
- styles25.button,
6454
+ styles26.button,
5793
6455
  {
5794
6456
  width: size,
5795
6457
  height: size,
@@ -5803,10 +6465,10 @@ function CallControlButton({
5803
6465
  children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: icon, size: large ? 30 : 25, color: iconColor, label: null })
5804
6466
  }
5805
6467
  ),
5806
- label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: styles25.label, children: label }) : null
6468
+ label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: styles26.label, children: label }) : null
5807
6469
  ] });
5808
6470
  }
5809
- var styles25 = reactNative.StyleSheet.create({
6471
+ var styles26 = reactNative.StyleSheet.create({
5810
6472
  // Fixed width so captions of different lengths cannot shift the row.
5811
6473
  slot: { width: 76, alignItems: "center", gap: 7 },
5812
6474
  button: { alignItems: "center", justifyContent: "center" },
@@ -5819,7 +6481,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
5819
6481
  reactNative.View,
5820
6482
  {
5821
6483
  style: [
5822
- styles26.ring,
6484
+ styles27.ring,
5823
6485
  {
5824
6486
  width: outer,
5825
6487
  height: outer,
@@ -5832,7 +6494,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
5832
6494
  reactNative.View,
5833
6495
  {
5834
6496
  style: [
5835
- styles26.circle,
6497
+ styles27.circle,
5836
6498
  {
5837
6499
  width: size,
5838
6500
  height: size,
@@ -5843,7 +6505,7 @@ function CallAvatar({ name, seed, size, speaking = false }) {
5843
6505
  children: /* @__PURE__ */ jsxRuntime.jsx(
5844
6506
  reactNative.Text,
5845
6507
  {
5846
- style: [styles26.initials, { fontSize: Math.round(size * 0.38) }],
6508
+ style: [styles27.initials, { fontSize: Math.round(size * 0.38) }],
5847
6509
  numberOfLines: 1,
5848
6510
  allowFontScaling: false,
5849
6511
  children: initialsOf(name)
@@ -5860,7 +6522,7 @@ function initialsOf(name) {
5860
6522
  if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
5861
6523
  return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
5862
6524
  }
5863
- var styles26 = reactNative.StyleSheet.create({
6525
+ var styles27 = reactNative.StyleSheet.create({
5864
6526
  ring: { alignItems: "center", justifyContent: "center" },
5865
6527
  circle: { alignItems: "center", justifyContent: "center" },
5866
6528
  initials: { color: "#ffffff", fontWeight: "600" }
@@ -5888,15 +6550,15 @@ function AudioRouteSheet({
5888
6550
  animationType: "fade",
5889
6551
  onRequestClose: onClose,
5890
6552
  ...EDGE_TO_EDGE_MODAL,
5891
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles27.backdrop, onPress: onClose, accessibilityRole: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(
6553
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles28.backdrop, onPress: onClose, accessibilityRole: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(
5892
6554
  reactNative.Pressable,
5893
6555
  {
5894
- style: [styles27.sheet, { paddingBottom: Math.max(34, insets.bottom + 16) }],
6556
+ style: [styles28.sheet, { paddingBottom: Math.max(34, insets.bottom + 16) }],
5895
6557
  onPress: () => {
5896
6558
  },
5897
6559
  children: [
5898
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles27.grabber }),
5899
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles27.title, children: "Audio output" }),
6560
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles28.grabber }),
6561
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles28.title, children: "Audio output" }),
5900
6562
  routes.map((route) => {
5901
6563
  const selected = route.id === selectedRouteId;
5902
6564
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -5908,7 +6570,7 @@ function AudioRouteSheet({
5908
6570
  },
5909
6571
  accessibilityRole: "button",
5910
6572
  accessibilityState: { selected },
5911
- style: ({ pressed }) => [styles27.row, pressed && styles27.rowPressed],
6573
+ style: ({ pressed }) => [styles28.row, pressed && styles28.rowPressed],
5912
6574
  children: [
5913
6575
  /* @__PURE__ */ jsxRuntime.jsx(
5914
6576
  PoolseIcon,
@@ -5919,7 +6581,7 @@ function AudioRouteSheet({
5919
6581
  label: null
5920
6582
  }
5921
6583
  ),
5922
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles27.label, selected && styles27.labelSelected], children: route.label }),
6584
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles28.label, selected && styles28.labelSelected], children: route.label }),
5923
6585
  selected && /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "check", size: 19, color: callColors.accept, label: "selected" })
5924
6586
  ]
5925
6587
  },
@@ -5932,7 +6594,7 @@ function AudioRouteSheet({
5932
6594
  }
5933
6595
  );
5934
6596
  }
5935
- var styles27 = reactNative.StyleSheet.create({
6597
+ var styles28 = reactNative.StyleSheet.create({
5936
6598
  backdrop: { flex: 1, backgroundColor: "rgba(0,0,0,0.55)", justifyContent: "flex-end" },
5937
6599
  sheet: {
5938
6600
  backgroundColor: callColors.tile,
@@ -6030,6 +6692,6 @@ exports.defaultLightTheme = defaultLightTheme;
6030
6692
  exports.useAppStateLifecycle = useAppStateLifecycle;
6031
6693
  exports.useCallDuration = useCallDuration;
6032
6694
  exports.useDisplayName = useDisplayName;
6033
- exports.usePoolseTheme = usePoolseTheme;
6695
+ exports.useTheme = useTheme;
6034
6696
  //# sourceMappingURL=index.cjs.map
6035
6697
  //# sourceMappingURL=index.cjs.map