@poolse/react-ui 3.2.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/CHANGELOG.md CHANGED
@@ -4,6 +4,79 @@ All notable changes to `@poolse/react-ui` are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
5
  [semver](https://semver.org).
6
6
 
7
+ ## [3.4.0] - 2026-11-21
8
+
9
+ ### Added
10
+
11
+ - `PoolseTheme` applies a `@poolse/theme` theme: `theme` takes a built-in id
12
+ (`coral`, `ocean`, `forest`, `grape`, `slate`, `sunset`, `rose`, `mono`) or a
13
+ `Theme`, `colorScheme` takes `'light' | 'dark' | 'system'` (default
14
+ `'system'`, follows the OS live). The theme's `--poolse-*` variables go on
15
+ the provider's own wrapper (`display: contents`), not `:root`; switching
16
+ restyles without remounting children. `useTheme()` returns
17
+ `{ theme: ResolvedTheme | null, colorScheme }`; `useSystemColorScheme()`.
18
+ - Re-exports `BUILT_IN_THEME_IDS`, `DEFAULT_THEME_ID`, `createTheme`,
19
+ `encodeTheme`, `decodeTheme` and the theme types from `@poolse/theme`.
20
+ - Stylesheet: a `[data-theme='light']` block, so a light-pinned subtree stays
21
+ light under a dark OS or a dark ancestor.
22
+ - `ConversationView` chat layouts: `layout="bubbles" | "list" | "compact"`
23
+ (default `bubbles`, unchanged). `list` is Slack-style — full-width
24
+ left-aligned rows, avatar + name + time once per run, later messages show
25
+ their time in the gutter on hover, a hover toolbar (React · Reply · Thread ·
26
+ More with Copy / Edit / Delete), "N replies" under thread roots. `compact` is
27
+ Discord/IRC-style — time, the name in the sender's `userColor`, and the text
28
+ on one line, small avatars only with `showAvatars`. Both mark messages that
29
+ @-mention the viewer with an accent bar and draw day dividers as a rule.
30
+ - `ConversationView` props `density` (`'comfortable' | 'compact'`),
31
+ `showAvatars` (overrides `avatars`; defaults `list` on, `compact` off),
32
+ `timeFormat` (`'12h' | '24h' | (date) => string`), `groupWindowMinutes`
33
+ (default 5), and `slots` — `header`, `body`, `attachments`, `reactions`,
34
+ `thread`, `actions`, each `(props) => ReactNode` receiving the message,
35
+ sender, layout, `isRunStart` and its default rendering as `children`; they
36
+ apply in every layout. Types `ChatLayout`, `ChatDensity`, `TimeFormat`,
37
+ `MessageSlots`, `MessageSlot`, `MessageSlotProps`, `RenderMessageContext`.
38
+ - `renderMessage` gets a third argument, `{ layout, groupPosition, isRunStart,
39
+ renderDefault }`; return `renderDefault()` to keep the built-in row.
40
+ - `MessageActions` `moreMenu` (Copy / Edit / Delete behind a "More" button);
41
+ `MessageBubble` `timeFormat`, `slots` / `slotContext`; `ThreadView` `layout`,
42
+ `timeFormat` (ConversationView passes its own).
43
+
44
+ ### Deprecated
45
+
46
+ - `ConversationView` `groupingWindowMs` — use `groupWindowMinutes` (still
47
+ honoured when that is unset).
48
+
49
+ ### Changed
50
+
51
+ - Bubbles, bubble links and the modal backdrop read the theme-only variables
52
+ `--poolse-own-bubble(-text)`, `--poolse-other-bubble(-text)`,
53
+ `--poolse-link`, `--poolse-overlay` and `--poolse-radius-bubble`, falling back
54
+ to the variables they read before — no visual change without a theme.
55
+
56
+ ## [3.3.0] - 2026-11-20
57
+
58
+ ### Added
59
+
60
+ - `ConversationView` props: `focusMessageId` (load older pages until the
61
+ message is there, scroll to it and flash it) with `onFocusMessageNotFound`;
62
+ `onSenderPress(user)` and `onAvatarPress(user)` (`MessageUser`, exported);
63
+ `composer={false}` / `readOnly` hide the composer (and quote-reply and
64
+ file dropping with it).
65
+ - `MessageRow` `onSenderPress` / `onAvatarPress`, `MessageBubble`
66
+ `onSenderPress`.
67
+
68
+ ### Changed
69
+
70
+ - After `ConversationView` marks a conversation read, its badge clears in
71
+ every `ConversationList` under the same provider (shared state in
72
+ `@poolse/react`), not just through `onMarkedRead`.
73
+
74
+ ### Fixed
75
+
76
+ - `MessageRow` resolved the avatar's profile by the poolse user id instead of
77
+ your user id (`external_id`), so avatars next to group messages fell back to
78
+ initials.
79
+
7
80
  ## [3.2.0] — 2026-11-17
8
81
 
9
82
  Stable release of everything in the 3.2.0 prereleases below (streaming agent replies, screen sharing, full screen, the redesigned call screen, screen sharing from iOS).
package/README.md CHANGED
@@ -46,7 +46,37 @@ export function Chat({ conversationId }: { conversationId: string }) {
46
46
  `labelFor`, `renderMessage`, `emptyState`, `loadFonts`, `maxBodyLength`
47
47
  (200), `groupingWindowMs` (300000), `senderLabels` and `avatars`
48
48
  (`'auto' | 'always' | 'never'`), `onMarkedRead`, `onCallBack`,
49
- `onJoinCall`, `currentCallId`.
49
+ `onJoinCall`, `currentCallId`, `focusMessageId` and
50
+ `onFocusMessageNotFound`, `onSenderPress` and `onAvatarPress` (receive a
51
+ `MessageUser`: `{ userId, externalId, displayName, avatarUrl }`), and
52
+ `composer={false}` (or `readOnly`) to hide the composer.
53
+
54
+ The view marks the latest message read while it's in view; once the server
55
+ accepts, every `ConversationList` / `useConversations()` under the same
56
+ provider drops that conversation's badge. `focusMessageId` loads older pages
57
+ until the message is there, scrolls to it and flashes it; a message it can't
58
+ find shows a short notice and calls `onFocusMessageNotFound`.
59
+
60
+ ## Layouts
61
+
62
+ ```tsx
63
+ <ConversationView conversationId={id} layout="list" density="compact" timeFormat="24h" />
64
+ ```
65
+
66
+ - `layout="bubbles"` (default) — chat bubbles, yours on the right.
67
+ - `layout="list"` — Slack-style rows: avatar, name and time once per run of
68
+ messages (`groupWindowMinutes`, default 5), the time on hover for the rest, a
69
+ hover toolbar (React · Reply · Thread · More), "N replies" under threads.
70
+ - `layout="compact"` — Discord/IRC-style lines: time, the sender's name in
71
+ their colour, the text; `showAvatars` adds small avatars. Messages that
72
+ mention you get an accent bar (also in `list`).
73
+
74
+ Reactions, threads, quotes, edits, deletes, attachments, read receipts, typing,
75
+ the new-messages button, `focusMessageId` and `onSenderPress` /
76
+ `onAvatarPress` work the same in all three. To change one part of every
77
+ message, pass `slots={{ header, body, attachments, reactions, thread, actions }}`
78
+ — each is `(props) => ReactNode` and gets the default rendering as `children`.
79
+ `renderMessage(msg, meId, { layout, renderDefault })` replaces whole rows.
50
80
 
51
81
  ## Components
52
82
 
@@ -64,13 +94,34 @@ export function Chat({ conversationId }: { conversationId: string }) {
64
94
  `@poolse/react`), `CallVideoGrid`, `CallControlButton`, `CallDeviceMenu`.
65
95
  - Identity and brand: `Avatar`, `UserName`, `useDisplayName`, `PoolseIcon`,
66
96
  `PoolseLogo`, `PoolseFonts`, `usePoolseFonts`.
97
+ - Theme: `PoolseTheme`, `useTheme`, `useSystemColorScheme`.
67
98
 
68
99
  Every `labelFor` / `avatarFor` takes your user id (`external_id`), except on
69
100
  `CallVideoGrid` and `RoomStage`, where it takes the poolse user id.
70
101
 
71
102
  ## Theming
72
103
 
73
- Override the `--poolse-*` CSS variables (`--poolse-brand`,
104
+ Wrap the UI in `PoolseTheme` to use one of the eight built-in themes from
105
+ [`@poolse/theme`](../theme) — `coral` (default), `ocean`, `forest`, `grape`,
106
+ `slate`, `sunset`, `rose`, `mono` — or your own:
107
+
108
+ ```tsx
109
+ import { PoolseTheme } from '@poolse/react-ui';
110
+
111
+ <PoolseTheme theme="ocean" colorScheme="system">
112
+ <PoolseInbox />
113
+ </PoolseTheme>;
114
+ ```
115
+
116
+ `theme` takes a built-in id or a `Theme` (`createTheme`, `decodeTheme` for a
117
+ shared theme code); `colorScheme` is `'light'`, `'dark'` or `'system'`
118
+ (default, follows the OS live). Changing either restyles in place — nothing
119
+ remounts. The variables are set on `PoolseTheme`'s own wrapper
120
+ (`display: contents`), not on `:root`, so differently themed chats can share a
121
+ page. `useTheme()` returns the active theme's tokens and scheme. Without
122
+ `theme`, nothing is set and the stylesheet's own colours apply.
123
+
124
+ Or override the `--poolse-*` CSS variables (`--poolse-brand`,
74
125
  `--poolse-brand-soft`, `--poolse-ink`, `--poolse-surface`,
75
126
  `--poolse-radius-md`, `--poolse-font-body`, …). Dark mode follows
76
127
  `prefers-color-scheme`; force it with `data-theme="dark"` or