@poolse/react-native 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,62 @@ All notable changes to `@poolse/react-native` are documented here.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
5
5
  versions follow [semver](https://semver.org).
6
6
 
7
+ ## [3.5.0] - 2026-11-21
8
+
9
+ - No changes; released with the other `@poolse/*` packages at 3.5.0.
10
+
11
+ ## [3.4.0] - 2026-11-21
12
+
13
+ ### Added
14
+
15
+ - `PoolseTheme` takes `theme` = a `@poolse/theme` built-in id (`coral`,
16
+ `ocean`, `forest`, `grape`, `slate`, `sunset`, `rose`, `mono`) or a `Theme`,
17
+ and `colorScheme` = `'light' | 'dark' | 'system'` (`'system'` follows
18
+ `useColorScheme()` live and is the default when `theme` is given). `fonts`
19
+ maps the theme onto font families you loaded. Switching re-renders without
20
+ remounting.
21
+ - `useTheme()` returns the active tokens as a `NativeTheme`
22
+ (`@poolse/theme` names: `colors.accent`, `colors.surfaceAlt`, `fonts.body`,
23
+ `radii.bubble`, …). Every component now reads its tokens from it.
24
+ - Re-exports `BUILT_IN_THEME_IDS`, `DEFAULT_THEME_ID`, `createTheme`,
25
+ `encodeTheme`, `decodeTheme` and the theme types from `@poolse/theme`.
26
+ - `ConversationView` chat layouts: `layout="bubbles" | "list" | "compact"`
27
+ (default `bubbles`, unchanged). `list` is Slack-style — full-width
28
+ left-aligned rows, avatar + name + time once per run, later messages' time
29
+ dimmed in the gutter, "N replies" under thread roots. `compact` is
30
+ Discord/IRC-style — time, the name in the sender's `userColor` and the text
31
+ on one line, 20px avatars only with `showAvatars`. Both mark messages that
32
+ @-mention the viewer with an accent bar, draw day dividers as a rule, and
33
+ open the same long-press actions sheet as bubbles.
34
+ - `ConversationView` props `density` (`'comfortable' | 'compact'`),
35
+ `showAvatars` (overrides `avatars`; defaults `list` on, `compact` off),
36
+ `timeFormat` (`'12h' | '24h' | (date) => string`), `groupWindowMinutes`
37
+ (default 5, was fixed), `daySeparators` (default `true`), and `slots` —
38
+ `header`, `body`, `attachments`, `reactions`, `thread`, `actions`, each
39
+ `(props) => ReactNode` receiving the message, sender, layout, `isRunStart`
40
+ and its default rendering as `children`, in every layout. Types
41
+ `ChatLayout`, `ChatDensity`, `TimeFormat`, `MessageSlots`, `MessageSlot`,
42
+ `MessageSlotProps`, `RenderMessageContext`.
43
+ - `renderMessage` gets a third argument, `{ layout, groupPosition, isRunStart,
44
+ renderDefault }`.
45
+ - `MessageRow` `layout`, `density`, `timeFormat`, `slots`, `mentionsMe`;
46
+ `MessageBubble` `timeFormat`, `density`, `slots` / `slotContext`;
47
+ `ThreadView` `layout`, `timeFormat`; `DaySeparator` `variant="rule"`;
48
+ `Avatar` `size="xs"` (20px).
49
+
50
+ ### Deprecated
51
+
52
+ - The legacy `PoolseTheme` override object (`theme={{ colors: { brand } }}`),
53
+ `mode` (use `colorScheme`) and `usePoolseTheme()` (use `useTheme()`). All
54
+ still work: overrides merge over the original palette as before, and
55
+ `usePoolseTheme()` returns the original shape for any theme.
56
+
57
+ ### Changed
58
+
59
+ - Own-bubble text, links and quote cards read `ownBubbleText` / `link`, and
60
+ the edit backdrop reads `overlay`; their values without a theme are
61
+ unchanged.
62
+
7
63
  ## [3.3.0] - 2026-11-20
8
64
 
9
65
  ### Added
package/README.md CHANGED
@@ -108,18 +108,59 @@ The names follow `@poolse/react-ui`, but the props differ in places (for
108
108
  example `ThreadView` needs `visible` and `onClose`, and there is no
109
109
  `EditableMessageBubble`); see the docs for each component's props.
110
110
 
111
+ ## Layouts
112
+
113
+ ```tsx
114
+ <ConversationView conversationId={id} layout="list" density="compact" timeFormat="24h" />
115
+ ```
116
+
117
+ `layout` is `'bubbles'` (default), `'list'` (Slack-style rows: avatar, name and
118
+ time once per run of messages, `groupWindowMinutes` apart at most) or
119
+ `'compact'` (IRC-style lines: time, coloured name, text). Long-press opens the
120
+ same actions sheet in every layout, and reactions, threads, quotes, edits,
121
+ deletes, attachments, read ticks, typing, the new-messages button,
122
+ `focusMessageId` and `onSenderPress` / `onAvatarPress` behave the same. Messages
123
+ that mention you get an accent bar in `list` and `compact`. Use
124
+ `slots={{ header, body, attachments, reactions, thread, actions }}` to replace
125
+ or wrap one part of every message (each slot gets the default as `children`),
126
+ or `renderMessage(msg, meId, { layout, renderDefault })` for whole rows.
127
+
111
128
  ## Theming
112
129
 
130
+ ```tsx
131
+ <PoolseTheme theme="ocean" colorScheme="system">
132
+ {children}
133
+ </PoolseTheme>
134
+ ```
135
+
136
+ `theme` takes one of the eight built-in themes from
137
+ [`@poolse/theme`](../theme) — `coral` (default), `ocean`, `forest`, `grape`,
138
+ `slate`, `sunset`, `rose`, `mono` — or a `Theme` (`createTheme`, or
139
+ `decodeTheme` for a shared theme code). `colorScheme` is `'light'`, `'dark'` or
140
+ `'system'` (follows the OS live; the default when `theme` is given). Switching
141
+ either re-renders in place; nothing remounts. React Native can't use the web
142
+ font stacks, so themes use the platform fonts unless you pass
143
+ `fonts={{ body: 'Inter', display: 'Inter', mono: 'JetBrainsMono' }}` with
144
+ names you loaded via expo-font.
145
+
146
+ Every component reads its colours, fonts, radii, spacing and shadows from
147
+ `useTheme()`, which returns the active tokens (`colors.accent`,
148
+ `colors.ownBubble`, `fonts.body`, `fonts.lineHeight` in px, `radii.bubble`,
149
+ `shadows.md` as a style, …). Use it in your own components too.
150
+
151
+ Without `theme`, the original palette is used (light unless `colorScheme` or
152
+ `mode` says otherwise). The original override form still works but is
153
+ deprecated:
154
+
113
155
  ```tsx
114
156
  <PoolseTheme mode="dark" theme={{ colors: { brand: '#ff5733' }, radii: { bubble: 18 } }}>
115
157
  {children}
116
158
  </PoolseTheme>
117
159
  ```
118
160
 
119
- Overrides merge over the light or dark base theme one group at a time
120
- (`colors`, `type`, `radii`, `spacing`, `shadows`). `mode` doesn't follow the
121
- system by itself; pass `useColorScheme()` if you want that. Read the active
122
- theme with `usePoolseTheme()`.
161
+ Overrides merge over the light or dark base palette one group at a time
162
+ (`colors`, `type`, `radii`, `spacing`, `shadows`); `usePoolseTheme()` still
163
+ returns that original shape.
123
164
 
124
165
  ## Links
125
166