@poolse/react-ui 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 +53 -0
- package/README.md +43 -1
- package/dist/index.cjs +664 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +148 -10
- package/dist/index.d.ts +148 -10
- package/dist/index.js +645 -179
- package/dist/index.js.map +1 -1
- package/dist/styles.css +388 -7
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,59 @@ 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.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` applies a `@poolse/theme` theme: `theme` takes a built-in id
|
|
16
|
+
(`coral`, `ocean`, `forest`, `grape`, `slate`, `sunset`, `rose`, `mono`) or a
|
|
17
|
+
`Theme`, `colorScheme` takes `'light' | 'dark' | 'system'` (default
|
|
18
|
+
`'system'`, follows the OS live). The theme's `--poolse-*` variables go on
|
|
19
|
+
the provider's own wrapper (`display: contents`), not `:root`; switching
|
|
20
|
+
restyles without remounting children. `useTheme()` returns
|
|
21
|
+
`{ theme: ResolvedTheme | null, colorScheme }`; `useSystemColorScheme()`.
|
|
22
|
+
- Re-exports `BUILT_IN_THEME_IDS`, `DEFAULT_THEME_ID`, `createTheme`,
|
|
23
|
+
`encodeTheme`, `decodeTheme` and the theme types from `@poolse/theme`.
|
|
24
|
+
- Stylesheet: a `[data-theme='light']` block, so a light-pinned subtree stays
|
|
25
|
+
light under a dark OS or a dark ancestor.
|
|
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 show
|
|
29
|
+
their time in the gutter on hover, a hover toolbar (React · Reply · Thread ·
|
|
30
|
+
More with Copy / Edit / Delete), "N replies" under thread roots. `compact` is
|
|
31
|
+
Discord/IRC-style — time, the name in the sender's `userColor`, and the text
|
|
32
|
+
on one line, small avatars only with `showAvatars`. Both mark messages that
|
|
33
|
+
@-mention the viewer with an accent bar and draw day dividers as a rule.
|
|
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), and `slots` — `header`, `body`, `attachments`, `reactions`,
|
|
38
|
+
`thread`, `actions`, each `(props) => ReactNode` receiving the message,
|
|
39
|
+
sender, layout, `isRunStart` and its default rendering as `children`; they
|
|
40
|
+
apply in every layout. Types `ChatLayout`, `ChatDensity`, `TimeFormat`,
|
|
41
|
+
`MessageSlots`, `MessageSlot`, `MessageSlotProps`, `RenderMessageContext`.
|
|
42
|
+
- `renderMessage` gets a third argument, `{ layout, groupPosition, isRunStart,
|
|
43
|
+
renderDefault }`; return `renderDefault()` to keep the built-in row.
|
|
44
|
+
- `MessageActions` `moreMenu` (Copy / Edit / Delete behind a "More" button);
|
|
45
|
+
`MessageBubble` `timeFormat`, `slots` / `slotContext`; `ThreadView` `layout`,
|
|
46
|
+
`timeFormat` (ConversationView passes its own).
|
|
47
|
+
|
|
48
|
+
### Deprecated
|
|
49
|
+
|
|
50
|
+
- `ConversationView` `groupingWindowMs` — use `groupWindowMinutes` (still
|
|
51
|
+
honoured when that is unset).
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- Bubbles, bubble links and the modal backdrop read the theme-only variables
|
|
56
|
+
`--poolse-own-bubble(-text)`, `--poolse-other-bubble(-text)`,
|
|
57
|
+
`--poolse-link`, `--poolse-overlay` and `--poolse-radius-bubble`, falling back
|
|
58
|
+
to the variables they read before — no visual change without a theme.
|
|
59
|
+
|
|
7
60
|
## [3.3.0] - 2026-11-20
|
|
8
61
|
|
|
9
62
|
### Added
|
package/README.md
CHANGED
|
@@ -57,6 +57,27 @@ provider drops that conversation's badge. `focusMessageId` loads older pages
|
|
|
57
57
|
until the message is there, scrolls to it and flashes it; a message it can't
|
|
58
58
|
find shows a short notice and calls `onFocusMessageNotFound`.
|
|
59
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.
|
|
80
|
+
|
|
60
81
|
## Components
|
|
61
82
|
|
|
62
83
|
- Composed: `PoolseInbox` (with a ref: `open`, `openDirect`, `openGroup`,
|
|
@@ -73,13 +94,34 @@ find shows a short notice and calls `onFocusMessageNotFound`.
|
|
|
73
94
|
`@poolse/react`), `CallVideoGrid`, `CallControlButton`, `CallDeviceMenu`.
|
|
74
95
|
- Identity and brand: `Avatar`, `UserName`, `useDisplayName`, `PoolseIcon`,
|
|
75
96
|
`PoolseLogo`, `PoolseFonts`, `usePoolseFonts`.
|
|
97
|
+
- Theme: `PoolseTheme`, `useTheme`, `useSystemColorScheme`.
|
|
76
98
|
|
|
77
99
|
Every `labelFor` / `avatarFor` takes your user id (`external_id`), except on
|
|
78
100
|
`CallVideoGrid` and `RoomStage`, where it takes the poolse user id.
|
|
79
101
|
|
|
80
102
|
## Theming
|
|
81
103
|
|
|
82
|
-
|
|
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`,
|
|
83
125
|
`--poolse-brand-soft`, `--poolse-ink`, `--poolse-surface`,
|
|
84
126
|
`--poolse-radius-md`, `--poolse-font-body`, …). Dark mode follows
|
|
85
127
|
`prefers-color-scheme`; force it with `data-theme="dark"` or
|