@poolse/react-ui 2.25.0 → 3.1.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 +19 -0
- package/LICENSE +206 -21
- package/README.md +48 -296
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ 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.1.0] — 2026-10-27
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Moves with `@poolse/sdk` and `@poolse/react` 3.1.0 (reconnect catch-up,
|
|
12
|
+
user-channel call events). README rewritten against the code;
|
|
13
|
+
`CallControlButton` docs corrected (it is styled by `styles.css`).
|
|
14
|
+
|
|
15
|
+
## [3.0.0] — 2026-10-26
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **License.** From 3.0.0 this package is under the poolse SDK License
|
|
20
|
+
(see `LICENSE`): free to use, including commercially, in apps built on
|
|
21
|
+
poolse; not for use with other backends or to build a competing
|
|
22
|
+
service. Versions before 3.0.0 remain MIT.
|
|
23
|
+
- First stable release; all `@poolse/*` packages move to 3.0.0 together.
|
|
24
|
+
Earlier versions are deprecated. See `MIGRATING.md`.
|
|
25
|
+
|
|
7
26
|
## [2.25.0] — 2026-10-22
|
|
8
27
|
|
|
9
28
|
### Removed
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,206 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
poolse SDK License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Torsten Labs DOO. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Version 1.0. Applies to poolse SDK releases from version 3.0.0 onwards.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
SUMMARY (NOT PART OF THE LICENSE TERMS)
|
|
9
|
+
|
|
10
|
+
This summary is for convenience only. It is not part of the license and
|
|
11
|
+
has no legal effect. If it differs from the terms below, the terms below
|
|
12
|
+
apply.
|
|
13
|
+
|
|
14
|
+
- You can use, copy and modify the SDK for free, including in
|
|
15
|
+
commercial apps, as long as your app talks to the poolse Services.
|
|
16
|
+
- You can ship the SDK inside your app, compiled or bundled, including
|
|
17
|
+
the native iOS and Android source code needed to build it.
|
|
18
|
+
- You cannot use the SDK with any other backend, use it to build a
|
|
19
|
+
competing chat, realtime, calling or push service, or redistribute
|
|
20
|
+
or sell it as a standalone library or SDK.
|
|
21
|
+
- Keep this license notice in copies of the SDK source.
|
|
22
|
+
- The SDK comes with no warranty.
|
|
23
|
+
- Versions published before 3.0.0 remain under the MIT License.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
TERMS AND CONDITIONS
|
|
27
|
+
|
|
28
|
+
1. Definitions
|
|
29
|
+
|
|
30
|
+
"Licensor" means Torsten Labs DOO, Ilindenska 335, 1200 Tetovo, North
|
|
31
|
+
Macedonia.
|
|
32
|
+
|
|
33
|
+
"You" means the individual or legal entity exercising rights under this
|
|
34
|
+
license. If you accept this license on behalf of an organisation, "you"
|
|
35
|
+
includes that organisation.
|
|
36
|
+
|
|
37
|
+
"SDK" means the software in this package or repository published by the
|
|
38
|
+
Licensor under this license, including source code, compiled code, native
|
|
39
|
+
iOS and Android code, type definitions, configuration plugins, examples
|
|
40
|
+
and documentation, together with any updates the Licensor provides under
|
|
41
|
+
this license.
|
|
42
|
+
|
|
43
|
+
"poolse Services" means the hosted services operated by the Licensor under
|
|
44
|
+
the name "poolse", currently offered at https://poolse.dev, including their
|
|
45
|
+
APIs, realtime, calling and push notification infrastructure. It also
|
|
46
|
+
includes any self-hosted or on-premise deployment of poolse that you have
|
|
47
|
+
licensed directly from the Licensor, for as long as that license is in
|
|
48
|
+
effect.
|
|
49
|
+
|
|
50
|
+
"Application" means a website, mobile app, desktop app, server or other
|
|
51
|
+
software product that you develop and that provides material functionality
|
|
52
|
+
of its own beyond the SDK.
|
|
53
|
+
|
|
54
|
+
"Derivative Work" means any modification of the SDK, and any work that
|
|
55
|
+
contains the SDK or a substantial portion of it.
|
|
56
|
+
|
|
57
|
+
2. License Grant
|
|
58
|
+
|
|
59
|
+
Subject to the terms of this license, the Licensor grants you a worldwide,
|
|
60
|
+
non-exclusive, non-transferable, royalty-free license to:
|
|
61
|
+
|
|
62
|
+
(a) install, use, copy and modify the SDK, and create Derivative Works,
|
|
63
|
+
solely to develop, test and operate Applications that use the poolse
|
|
64
|
+
Services; and
|
|
65
|
+
|
|
66
|
+
(b) distribute the SDK and your Derivative Works, in source or compiled
|
|
67
|
+
form, only as an integrated part of your Applications. This includes
|
|
68
|
+
bundled or minified JavaScript and the native iOS and Android source
|
|
69
|
+
code that must be included for your Application to be compiled.
|
|
70
|
+
|
|
71
|
+
Your Applications may be commercial, and you may charge for them.
|
|
72
|
+
|
|
73
|
+
3. Restrictions
|
|
74
|
+
|
|
75
|
+
You may not, and may not allow anyone else to:
|
|
76
|
+
|
|
77
|
+
(a) use the SDK or any Derivative Work with, or adapt it to connect to,
|
|
78
|
+
any backend, API or service other than the poolse Services;
|
|
79
|
+
|
|
80
|
+
(b) use the SDK or any Derivative Work to build, offer or operate a
|
|
81
|
+
product or service that competes with the poolse Services, including
|
|
82
|
+
any chat, messaging, realtime, voice or video calling, or push
|
|
83
|
+
notification service or infrastructure offered to third parties;
|
|
84
|
+
|
|
85
|
+
(c) sell, sublicense, rent, lease or distribute the SDK or any Derivative
|
|
86
|
+
Work on its own, or as a library, SDK, framework, component kit or
|
|
87
|
+
developer tool, rather than as an integrated part of an Application;
|
|
88
|
+
|
|
89
|
+
(d) remove, alter or obscure this license, any copyright notice, or any
|
|
90
|
+
other proprietary notice in the SDK; or
|
|
91
|
+
|
|
92
|
+
(e) use the SDK in violation of applicable law or of the terms of service
|
|
93
|
+
that govern your use of the poolse Services.
|
|
94
|
+
|
|
95
|
+
Nothing in this license grants you any right to use the poolse Services
|
|
96
|
+
themselves. Your use of the poolse Services is governed by your separate
|
|
97
|
+
agreement with the Licensor, including its terms of service.
|
|
98
|
+
|
|
99
|
+
4. Notices
|
|
100
|
+
|
|
101
|
+
Any copy of the SDK or a Derivative Work in source form, including native
|
|
102
|
+
source code distributed with an Application, must keep this license file
|
|
103
|
+
or a clear reference to it. You do not need to display this license to the
|
|
104
|
+
end users of your Application.
|
|
105
|
+
|
|
106
|
+
5. Contributions
|
|
107
|
+
|
|
108
|
+
If you submit code, documentation or other material to the Licensor for
|
|
109
|
+
inclusion in the SDK (for example, as a pull request), you grant the
|
|
110
|
+
Licensor a perpetual, worldwide, irrevocable, royalty-free license to use,
|
|
111
|
+
modify, sublicense and distribute that material as part of the SDK or any
|
|
112
|
+
other Licensor product, and you confirm that you have the right to grant
|
|
113
|
+
that license.
|
|
114
|
+
|
|
115
|
+
6. Ownership
|
|
116
|
+
|
|
117
|
+
The SDK is licensed, not sold. The Licensor and its licensors keep all
|
|
118
|
+
rights, title and interest in the SDK, including all intellectual property
|
|
119
|
+
rights. All rights not expressly granted in this license are reserved. The
|
|
120
|
+
names "poolse" and "Torsten Labs" and their logos are not licensed to you
|
|
121
|
+
except as needed to truthfully describe that your Application uses the
|
|
122
|
+
poolse Services.
|
|
123
|
+
|
|
124
|
+
You own your modifications to the SDK, subject to the Licensor's rights in
|
|
125
|
+
the SDK and to the terms of this license.
|
|
126
|
+
|
|
127
|
+
7. Feedback
|
|
128
|
+
|
|
129
|
+
If you give the Licensor suggestions or feedback about the SDK, the
|
|
130
|
+
Licensor may use them without any obligation to you.
|
|
131
|
+
|
|
132
|
+
8. Termination
|
|
133
|
+
|
|
134
|
+
This license ends automatically, without notice, if you breach any of its
|
|
135
|
+
terms. If you cure the breach within 30 days after you become aware of it,
|
|
136
|
+
your license is reinstated, unless the Licensor has notified you in writing
|
|
137
|
+
that it is terminating your license, or you have breached this license
|
|
138
|
+
before.
|
|
139
|
+
|
|
140
|
+
When this license ends, you must stop using and distributing the SDK and
|
|
141
|
+
your Derivative Works, and delete all copies in your possession. Copies of
|
|
142
|
+
Applications already delivered to end users before termination may continue
|
|
143
|
+
to be used by those end users. Sections 3, 5, 6, 7, 9, 10, 11 and 12
|
|
144
|
+
survive termination.
|
|
145
|
+
|
|
146
|
+
9. Disclaimer of Warranty
|
|
147
|
+
|
|
148
|
+
THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY
|
|
149
|
+
KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE
|
|
150
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
|
|
151
|
+
NON-INFRINGEMENT. THE LICENSOR DOES NOT WARRANT THAT THE SDK WILL BE
|
|
152
|
+
ERROR-FREE, SECURE OR UNINTERRUPTED. YOU USE THE SDK AT YOUR OWN RISK.
|
|
153
|
+
|
|
154
|
+
10. Limitation of Liability
|
|
155
|
+
|
|
156
|
+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL THE
|
|
157
|
+
LICENSOR, ITS AFFILIATES OR ITS CONTRIBUTORS BE LIABLE FOR ANY INDIRECT,
|
|
158
|
+
INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY OR PUNITIVE DAMAGES, OR FOR
|
|
159
|
+
ANY LOSS OF PROFITS, REVENUE, DATA, GOODWILL OR BUSINESS OPPORTUNITY,
|
|
160
|
+
ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE SDK, WHETHER IN
|
|
161
|
+
CONTRACT, TORT (INCLUDING NEGLIGENCE) OR OTHERWISE, EVEN IF ADVISED OF THE
|
|
162
|
+
POSSIBILITY OF SUCH DAMAGES. BECAUSE THE SDK IS PROVIDED FREE OF CHARGE,
|
|
163
|
+
THE LICENSOR'S TOTAL LIABILITY ARISING OUT OF OR IN CONNECTION WITH THIS
|
|
164
|
+
LICENSE OR THE SDK WILL NOT EXCEED ONE HUNDRED EUROS (EUR 100).
|
|
165
|
+
|
|
166
|
+
NOTHING IN THIS LICENSE EXCLUDES OR LIMITS ANY LIABILITY THAT CANNOT BE
|
|
167
|
+
EXCLUDED OR LIMITED UNDER APPLICABLE LAW, INCLUDING LIABILITY FOR WILFUL
|
|
168
|
+
MISCONDUCT OR GROSS NEGLIGENCE.
|
|
169
|
+
|
|
170
|
+
11. Governing Law and Disputes
|
|
171
|
+
|
|
172
|
+
This license is governed by the laws of the Republic of North Macedonia,
|
|
173
|
+
without regard to its conflict of laws rules. The courts of the Republic of
|
|
174
|
+
North Macedonia have exclusive jurisdiction over any dispute arising out of
|
|
175
|
+
or in connection with this license, except that the Licensor may seek
|
|
176
|
+
injunctive relief to protect its intellectual property in any court of
|
|
177
|
+
competent jurisdiction.
|
|
178
|
+
|
|
179
|
+
12. General
|
|
180
|
+
|
|
181
|
+
This license is the entire agreement between you and the Licensor about the
|
|
182
|
+
SDK. If any provision is found unenforceable, it will be enforced to the
|
|
183
|
+
maximum extent possible and the remaining provisions stay in effect. A
|
|
184
|
+
failure to enforce a provision is not a waiver. You may not assign this
|
|
185
|
+
license without the Licensor's prior written consent. The Licensor may
|
|
186
|
+
publish new versions of this license; each release of the SDK is governed
|
|
187
|
+
by the version of this license included with it.
|
|
188
|
+
|
|
189
|
+
13. Earlier Versions
|
|
190
|
+
|
|
191
|
+
Versions of the poolse SDK packages published before version 3.0.0
|
|
192
|
+
(including @poolse/sdk, @poolse/react, @poolse/react-ui and
|
|
193
|
+
@poolse/react-native) were released under the MIT License and remain
|
|
194
|
+
available under the MIT License. This license applies only to versions
|
|
195
|
+
3.0.0 and later, and to any package first published by the Licensor under
|
|
196
|
+
this license.
|
|
197
|
+
|
|
198
|
+
14. Contact
|
|
199
|
+
|
|
200
|
+
Questions about this license, or requests for permission beyond it, can be
|
|
201
|
+
sent to legal@poolse.dev.
|
|
202
|
+
|
|
203
|
+
Torsten Labs DOO
|
|
204
|
+
Ilindenska 335
|
|
205
|
+
1200 Tetovo
|
|
206
|
+
North Macedonia
|
package/README.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# `@poolse/react-ui`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Prebuilt React web components for [poolse](https://poolse.dev):
|
|
4
|
+
`<PoolseInbox>` for a whole inbox, `<ConversationView>` for one chat, room UI,
|
|
5
|
+
and the pieces they are built from. Themed with CSS variables. Built on
|
|
6
|
+
[`@poolse/react`](https://www.npmjs.com/package/@poolse/react).
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Sits on top of [`@poolse/react`](https://www.npmjs.com/package/@poolse/react) (hooks) and [`@poolse/sdk`](https://www.npmjs.com/package/@poolse/sdk) (client).
|
|
8
|
-
|
|
9
|
-
> **⚠️ Upgrading from 1.x?** See [MIGRATING.md](https://github.com/poolse-hq/js-sdk/blob/main/MIGRATING.md). Every `labelFor` / `avatarFor` / `onlineUserIds` prop is now keyed by `external_id`. `<UserName>` and `useDisplayName` switched from `userId` to `externalId`.
|
|
8
|
+
Full reference: <https://poolse.dev/docs/sdk/react-ui>
|
|
10
9
|
|
|
11
10
|
## Install
|
|
12
11
|
|
|
@@ -18,318 +17,71 @@ npm install @poolse/react-ui @poolse/react @poolse/sdk
|
|
|
18
17
|
import '@poolse/react-ui/styles.css';
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
Peer: `react` ≥ 18. The build starts with `'use client'`. Rooms also need
|
|
21
|
+
`livekit-client` in your app.
|
|
22
22
|
|
|
23
23
|
## Quick start
|
|
24
24
|
|
|
25
25
|
```tsx
|
|
26
|
+
'use client';
|
|
27
|
+
|
|
28
|
+
import '@poolse/react-ui/styles.css';
|
|
26
29
|
import { PoolseProvider } from '@poolse/react';
|
|
27
30
|
import { ConversationView } from '@poolse/react-ui';
|
|
28
|
-
import '@poolse/react-ui/styles.css';
|
|
29
31
|
|
|
30
|
-
export function
|
|
32
|
+
export function Chat({ conversationId }: { conversationId: string }) {
|
|
31
33
|
return (
|
|
32
|
-
<PoolseProvider
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const { token } = await res.json();
|
|
37
|
-
return token;
|
|
38
|
-
},
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<ConversationView conversationId="00000000-0000-0000-0000-000000000000" />
|
|
34
|
+
<PoolseProvider config={config}>
|
|
35
|
+
<div style={{ height: '100vh' }}>
|
|
36
|
+
<ConversationView conversationId={conversationId} />
|
|
37
|
+
</div>
|
|
42
38
|
</PoolseProvider>
|
|
43
39
|
);
|
|
44
40
|
}
|
|
45
41
|
```
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<ConversationView
|
|
55
|
-
conversationId={id}
|
|
56
|
-
|
|
57
|
-
// Feature toggles (all default true unless noted)
|
|
58
|
-
reactions
|
|
59
|
-
mentions
|
|
60
|
-
attachments
|
|
61
|
-
actions
|
|
62
|
-
threads
|
|
63
|
-
quotations
|
|
64
|
-
readReceipts
|
|
65
|
-
markdown
|
|
66
|
-
grouping
|
|
67
|
-
daySeparators
|
|
68
|
-
|
|
69
|
-
// Behavioral knobs
|
|
70
|
-
maxBodyLength={200} // 0 disables the "Read more" trim
|
|
71
|
-
groupingWindowMs={300000} // 5 min — same-sender messages within this window cluster
|
|
72
|
-
senderLabels="auto" // 'auto' (on for 3+ members) | 'always' | 'never'
|
|
73
|
-
avatars="auto" // same
|
|
74
|
-
|
|
75
|
-
// Customer wiring
|
|
76
|
-
labelFor={(userId) => /* … */}
|
|
77
|
-
onMarkedRead={(convId) => /* clear sidebar badge */}
|
|
78
|
-
renderMessage={(msg, currentUserId) => /* fully custom row */}
|
|
79
|
-
emptyState={<div>Say hi.</div>}
|
|
80
|
-
loadFonts // default true
|
|
81
|
-
/>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### What it gives you
|
|
85
|
-
|
|
86
|
-
- **Message list with infinite-scroll-up.** Top-sentinel `IntersectionObserver` fires `loadMore()` when the user gets within ~400px of the top.
|
|
87
|
-
- **Smart auto-scroll.** Stays pinned to the bottom while the user is at the bottom; otherwise increments a "N new messages" badge.
|
|
88
|
-
- **Auto mark-read.** When the latest message is in view, fires `markReadUpTo` once per fresh tail. Drives both your own progress (`onMarkedRead` callback) and the server-broadcast read receipt that flips other users' double-check glyph.
|
|
89
|
-
- **Drag-and-drop attachments.** The whole conversation pane accepts a file drop and forwards it to the composer's upload queue.
|
|
90
|
-
- **Quote-reply chip** above the composer when `quotations` is on. The chip carries the quoted sender + a snippet, and Esc dismisses it.
|
|
91
|
-
- **Realtime status banner.** Renders "Connecting…" / "Reconnecting…" / "Disconnected" pills when the socket isn't connected.
|
|
92
|
-
- **Thread side-pane** opens on the right when the user clicks "Reply in thread"; below 760px it goes full-screen.
|
|
93
|
-
- **Day separators.** "Today" / "Yesterday" / weekday name / `26 May 2024` between calendar days.
|
|
94
|
-
- **Message clustering.** Same sender, same day, within `groupingWindowMs` (default 5 min) — clustered with a single asymmetric tail on the last bubble (iMessage / WhatsApp convention).
|
|
95
|
-
- **Markdown bodies.** GitHub-flavored, sanitized: bold/italic/lists/code/blockquotes/strikethrough/autolinks. URLs render with `target="_blank" rel="noopener noreferrer nofollow"`.
|
|
96
|
-
- **Long-message trim.** Bodies past `maxBodyLength` collapse to a `Read more` toggle.
|
|
97
|
-
|
|
98
|
-
### `renderMessage` escape hatch
|
|
99
|
-
|
|
100
|
-
`renderMessage` completely replaces the default `<MessageRow>` for each message — you own the layout from the bubble outward. Group position, avatars, sender labels, hover actions: none of that is wired automatically when you take the slot.
|
|
101
|
-
|
|
102
|
-
```tsx
|
|
103
|
-
<ConversationView
|
|
104
|
-
conversationId={id}
|
|
105
|
-
renderMessage={(msg, currentUserId) => (
|
|
106
|
-
<MyCustomBubble message={msg} isSelf={msg.sender_id === currentUserId} />
|
|
107
|
-
)}
|
|
108
|
-
/>
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
If you want to keep most of the default behavior, render `<MessageRow>` yourself with the props you'd like to flip.
|
|
43
|
+
`ConversationView` feature flags, all on by default: `reactions`,
|
|
44
|
+
`mentions`, `attachments`, `actions`, `threads`, `quotations`,
|
|
45
|
+
`readReceipts`, `markdown`, `grouping`, `daySeparators`. Other props:
|
|
46
|
+
`labelFor`, `renderMessage`, `emptyState`, `loadFonts`, `maxBodyLength`
|
|
47
|
+
(200), `groupingWindowMs` (300000), `senderLabels` and `avatars`
|
|
48
|
+
(`'auto' | 'always' | 'never'`), `onMarkedRead`, `onCallBack`,
|
|
49
|
+
`onJoinCall`, `currentCallId`.
|
|
112
50
|
|
|
113
51
|
## Components
|
|
114
52
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
| Component | What |
|
|
134
|
-
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
135
|
-
| `<MessageRow>` | One fully-wired row: bubble + (optional) avatar + reaction strip + thread pill + hover actions. Owns a single `useReactions` instance shared by the inline strip and the picker. |
|
|
136
|
-
| `<MessageBubble>` | Just the bubble — sender label, quoted card, attachments, body, meta. Pure presentational; takes `Message` + `currentUserId`. |
|
|
137
|
-
| `<EditableMessageBubble>` | `<MessageBubble>` plus an in-place edit mode (textarea, Enter to save, Esc to cancel). Controlled via the `editing` prop. |
|
|
138
|
-
| `<MessageActions>` | Hover popover with the react / reply / quote / copy / edit / delete affordances. |
|
|
139
|
-
| `<TypingIndicator>` | Three bouncing dots + a `role="status"` live region announcing "Alice is typing" / "Alice and Bob are typing" / "3 people are typing". |
|
|
140
|
-
|
|
141
|
-
### Composer
|
|
142
|
-
|
|
143
|
-
| Component | What |
|
|
144
|
-
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
145
|
-
| `<MessageComposer>` | Pill input + send button + paperclip → upload queue. Smart list continuation (Enter on `- item` repeats the bullet). Exposes an imperative `addFiles(files)` via `ref` for drag-drop callers. |
|
|
146
|
-
| `<MentionInput>` | Same as `<MessageComposer>` but with `@`-autocomplete from the conversation's member list. `combobox` ARIA, keyboard-navigable dropdown. Sends `MessageCreateRequest` shape (including `mentions[]`) on submit. |
|
|
147
|
-
| `<UploadQueueStrip>` | Renders one chip per item in the composer's upload queue — pending/uploading/ready/error — with cancel + dismiss. Live progress bar driven by the SDK's XHR-based upload. |
|
|
148
|
-
|
|
149
|
-
### Attachments
|
|
150
|
-
|
|
151
|
-
| Component | What |
|
|
152
|
-
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
153
|
-
| `<AttachmentPreview>` | Inline image (lazy thumbnail → fullscreen lightbox on click) or a file card with download. Resolves the presigned URL via `useAttachmentUrl`. |
|
|
154
|
-
|
|
155
|
-
### Conversation roster
|
|
156
|
-
|
|
157
|
-
| Component | What |
|
|
158
|
-
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
159
|
-
| `<ConversationList>` | Sidebar list of the user's conversations. Avatar + name + `last_message_preview` + timestamp + unread pill. Direct rows resolve the other member's name/avatar via `labelFor` / `avatarFor` (the same resolvers `<ChatHeader>` and `<PoolseInbox>` take), so a customer can wire one mapping everywhere. Controlled mode: pass `conversations`/`loading`/`error` to render from external state instead of `useConversations()`. |
|
|
160
|
-
| `<MemberList>` | Roster for one conversation. Role badges, online dot, optional remove button gated by a `canRemove(membership)` predicate. |
|
|
161
|
-
|
|
162
|
-
### Reactions
|
|
163
|
-
|
|
164
|
-
| Component | What |
|
|
165
|
-
| ------------------ | ------------------------------------------------------------------------------------------------ |
|
|
166
|
-
| `<ReactionStrip>` | Inline emoji pills with counts + "your reaction" highlight; optional picker button on the right. |
|
|
167
|
-
| `<ReactionPicker>` | Standalone emoji popover. Six common emojis, arrow-key navigation, Esc closes. |
|
|
168
|
-
|
|
169
|
-
### Identity
|
|
170
|
-
|
|
171
|
-
| Component | What |
|
|
172
|
-
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
173
|
-
| `<Avatar>` | Circular image with initials fallback + green presence dot. `size: 'sm' \| 'md' \| 'lg'`. |
|
|
174
|
-
| `<UserName>` / `useDisplayName` | Resolve a `user_id` to a display string via the configured `userResolver`, with a `labelFor` sync override and a stable fallback (`User abc123`) when nothing is available. |
|
|
175
|
-
|
|
176
|
-
### Brand chrome
|
|
177
|
-
|
|
178
|
-
| Component | What |
|
|
179
|
-
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
180
|
-
| `<PoolseIcon name="…">` | One SVG icon from a built-in set (41 names: `attachment`, `bell`, `check`, `chevron-down`, `close`, `download`, `edit`, `emoji`, `heart`, `image`, `message`, `messages`, `pin`, `plus`, `presence`, `pulse`, `reply`, `search`, `send`, `send-fill`, `settings`, `thumbs-up`, `trash`, `typing`, `user`, `users`, `webhook`, …). Pass `label={null}` for purely decorative. |
|
|
181
|
-
| `<PoolseLogo>` | Brand mark / lockup / wordmark / mono (single-color) variants. |
|
|
182
|
-
| `<PoolseFonts />` / `usePoolseFonts()` | Inject the Google Fonts link into `<head>` (idempotent). `<ConversationView>` calls this automatically unless you pass `loadFonts={false}`. |
|
|
183
|
-
|
|
184
|
-
## Attachments inside the bubble (1.1.0+)
|
|
185
|
-
|
|
186
|
-
As of 1.1.0, `<MessageBubble>` renders attachments **inside** the bubble (WhatsApp / iMessage convention) rather than as a separate block under it.
|
|
187
|
-
|
|
188
|
-
The layout chooses a grid template by image count:
|
|
189
|
-
|
|
190
|
-
| Count | Layout |
|
|
191
|
-
| --------- | ----------------------------------------------------------------------------- |
|
|
192
|
-
| 1 image | Single full-bleed tile, natural aspect, capped at 360px tall. |
|
|
193
|
-
| 2 images | Two equal squares, side-by-side. |
|
|
194
|
-
| 3 images | One 16:9 hero on top + two squares beneath. |
|
|
195
|
-
| 4+ images | 2×2 grid. The 4th tile shows a `+N more` overlay when the total exceeds four. |
|
|
196
|
-
|
|
197
|
-
Non-image attachments (PDFs, etc.) render as stacked file cards inside the bubble's padded area, below the image mosaic. On self-bubbles the cards tint white-on-coral to read against the brand color.
|
|
198
|
-
|
|
199
|
-
When a message has **only** images (no body text and no file cards), the meta row (time + read tick) becomes a small dark pill overlaid on the bottom-right of the mosaic — same convention as WhatsApp.
|
|
200
|
-
|
|
201
|
-
The bubble has `overflow: hidden` so the mosaic is clipped to the bubble's rounded corners and the asymmetric tail.
|
|
202
|
-
|
|
203
|
-
### Opting out
|
|
204
|
-
|
|
205
|
-
```tsx
|
|
206
|
-
<MessageBubble message={msg} currentUserId={meId} showAttachments={false} />
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Pass `showAttachments={false}` to suppress in-bubble attachments — useful if you want to render them yourself outside the bubble. `<MessageRow>` forwards its `attachments` flag to this prop, and `<ConversationView>`'s `attachments` flag forwards to `<MessageRow>`.
|
|
210
|
-
|
|
211
|
-
### Migration from 1.0.x
|
|
212
|
-
|
|
213
|
-
Anything customizing `.poolse-message-row__attachments` in your stylesheet won't match anymore — that class is no longer rendered. The new class names are:
|
|
214
|
-
|
|
215
|
-
- `.poolse-message__media` — image mosaic container
|
|
216
|
-
- `.poolse-message__media--n1` / `--n2` / `--n3` / `--n4` — count-specific grid templates
|
|
217
|
-
- `.poolse-message__media-tile` — one image cell
|
|
218
|
-
- `.poolse-message__media-overflow` — the `+N more` overlay
|
|
219
|
-
- `.poolse-message__files` — file-card stack
|
|
220
|
-
- `.poolse-message__meta--overlay` — modifier applied to `.poolse-message__meta` in image-only mode
|
|
221
|
-
- `.poolse-message--has-media` / `--media-only` — parent state modifiers
|
|
222
|
-
|
|
223
|
-
If you weren't styling the old class, you don't need to do anything — the new layout is on by default.
|
|
53
|
+
- Composed: `PoolseInbox` (with a ref: `open`, `openDirect`, `openGroup`,
|
|
54
|
+
`promptNewChat`, `promptNewGroup`, `close`), `ConversationView`,
|
|
55
|
+
`ChatHeader`, `ThreadView`.
|
|
56
|
+
- Sheets: `UserPickerSheet`, `GroupDetailsSheet`.
|
|
57
|
+
- Messages: `MessageBubble`, `EditableMessageBubble`, `MessageActions`,
|
|
58
|
+
`TypingIndicator`, `CallLogRow`, `LiveCallBanner`.
|
|
59
|
+
- Composer: `MessageComposer` (ref: `addFiles`), `MentionInput`,
|
|
60
|
+
`UploadQueueStrip`, `AttachmentPreview`.
|
|
61
|
+
- Lists: `ConversationList`, `MemberList`.
|
|
62
|
+
- Reactions: `ReactionStrip`, `ReactionPicker`.
|
|
63
|
+
- Rooms and calls: `RoomJoinBar`, `RoomStage` (both take `useRoom()` from
|
|
64
|
+
`@poolse/react`), `CallVideoGrid`, `CallControlButton`, `CallDeviceMenu`.
|
|
65
|
+
- Identity and brand: `Avatar`, `UserName`, `useDisplayName`, `PoolseIcon`,
|
|
66
|
+
`PoolseLogo`, `PoolseFonts`, `usePoolseFonts`.
|
|
67
|
+
|
|
68
|
+
Every `labelFor` / `avatarFor` takes your user id (`external_id`), except on
|
|
69
|
+
`CallVideoGrid` and `RoomStage`, where it takes the poolse user id.
|
|
224
70
|
|
|
225
71
|
## Theming
|
|
226
72
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
--poolse-brand-soft: #e0eaff; /* tinted fills, hover, badges */
|
|
233
|
-
--poolse-brand-strong: #0050b3; /* AA text on light surfaces */
|
|
234
|
-
--poolse-on-brand: #ffffff; /* foreground on brand */
|
|
235
|
-
}
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
The full token set:
|
|
239
|
-
|
|
240
|
-
```css
|
|
241
|
-
/* Brand & surfaces */
|
|
242
|
-
--poolse-brand /* primary action (default Pulse Coral #ff5436) */
|
|
243
|
-
--poolse-brand-strong /* AA text on light */
|
|
244
|
-
--poolse-brand-soft /* tinted fills, badges, hover */
|
|
245
|
-
--poolse-on-brand /* foreground on brand */
|
|
246
|
-
--poolse-paper /* page background */
|
|
247
|
-
--poolse-surface /* cards, panels */
|
|
248
|
-
--poolse-surface-2 /* insets, fields */
|
|
249
|
-
--poolse-ink /* primary text */
|
|
250
|
-
--poolse-ink-2 /* secondary text */
|
|
251
|
-
--poolse-ink-3 /* tertiary, hints */
|
|
252
|
-
--poolse-border /* hairline borders */
|
|
253
|
-
|
|
254
|
-
/* Semantic */
|
|
255
|
-
--poolse-presence /* online dot */
|
|
256
|
-
--poolse-success
|
|
257
|
-
--poolse-warning
|
|
258
|
-
--poolse-error /* distinct from coral */
|
|
259
|
-
--poolse-info
|
|
260
|
-
|
|
261
|
-
/* Typography */
|
|
262
|
-
--poolse-font-display /* Bricolage Grotesque */
|
|
263
|
-
--poolse-font-body /* Hanken Grotesk */
|
|
264
|
-
--poolse-font-mono /* JetBrains Mono */
|
|
265
|
-
--poolse-font-size /* default 15px */
|
|
266
|
-
--poolse-line-height /* default 1.5 */
|
|
267
|
-
|
|
268
|
-
/* Radii */
|
|
269
|
-
--poolse-radius-sm /* 8px */
|
|
270
|
-
--poolse-radius-md /* 12px */
|
|
271
|
-
--poolse-radius-lg /* 16px */
|
|
272
|
-
--poolse-radius-xl /* 24px */
|
|
273
|
-
--poolse-radius-pill /* 999px */
|
|
274
|
-
|
|
275
|
-
/* Shadows (warm-tinted) */
|
|
276
|
-
--poolse-shadow-sm
|
|
277
|
-
--poolse-shadow-md
|
|
278
|
-
--poolse-shadow-lg
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
### Dark mode
|
|
282
|
-
|
|
283
|
-
The stylesheet ships with a dark theme keyed off the user's `prefers-color-scheme`. To force a mode, set `data-theme="dark"` or `data-theme="light"` on any ancestor of the chat surface:
|
|
284
|
-
|
|
285
|
-
```html
|
|
286
|
-
<div data-theme="dark">
|
|
287
|
-
<ConversationView ... />
|
|
288
|
-
</div>
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
## Accessibility
|
|
292
|
-
|
|
293
|
-
- `<div role="log" aria-live="polite" aria-relevant="additions">` on the message list — screen readers announce new messages but not the initial load.
|
|
294
|
-
- `<aside role="complementary" aria-label="Message thread">` on the thread pane. Esc closes; close button auto-focuses on mount.
|
|
295
|
-
- `<MentionInput>` is a proper combobox: `role="combobox"`, `aria-expanded`, `aria-controls`, `aria-autocomplete="list"`, `aria-activedescendant` on the input; the dropdown is `role="listbox"` with `role="option"` items.
|
|
296
|
-
- `<ReactionPicker>` is `role="menu"` / `role="menuitem"` with arrow-key navigation and Esc to close.
|
|
297
|
-
- `<TypingIndicator>` is `role="status" aria-live="polite" aria-atomic="true"`; the dots themselves are `aria-hidden`.
|
|
298
|
-
- `<Avatar>` is `role="img" aria-label="{name}"` even when rendering initials.
|
|
299
|
-
- Touch reveal: the hover action menu on `<MessageRow>` is hidden on `(hover: none)` and switches to tap-toggle on the bubble itself, so you don't lose actions on mobile.
|
|
300
|
-
- The image lightbox locks body scroll while open, closes on Esc and on backdrop click, and keeps the image itself non-dismissable (so a click on the image doesn't accidentally close).
|
|
301
|
-
- The whole kit honors `prefers-reduced-motion` for the typing indicator, the message-row hover transitions, and the thread pane slide-in.
|
|
302
|
-
|
|
303
|
-
Touch targets in the composer are 44px; the textarea uses 16px so iOS doesn't auto-zoom on focus; the lightbox + composer apply `safe-area-inset` padding for notched devices.
|
|
304
|
-
|
|
305
|
-
## Customization layers
|
|
306
|
-
|
|
307
|
-
In order of escalating control:
|
|
308
|
-
|
|
309
|
-
1. **CSS variables.** Re-skin without touching JS.
|
|
310
|
-
2. **Feature flags on `<ConversationView>`.** Turn whole features off (`reactions={false}`, `threads={false}`, etc.).
|
|
311
|
-
3. **Render-prop slots.** Replace individual rows: `<ConversationView renderMessage={...}>`, `<ConversationList renderItem={...}>`, `<MemberList renderItem={...}>`, `<ThreadView renderMessage={...}>`.
|
|
312
|
-
4. **Component composition.** Drop `<ConversationView>` and assemble `<MessageRow>` (or `<MessageBubble>` if you want to skip the row's wiring) + `<MessageComposer>` + `<TypingIndicator>` + `<ThreadView>` yourself.
|
|
313
|
-
5. **Drop down to `@poolse/react`.** Build your own components on the same hooks that this package uses internally.
|
|
314
|
-
|
|
315
|
-
You can mix and match — there's no all-or-nothing boundary.
|
|
316
|
-
|
|
317
|
-
## Re-exports
|
|
318
|
-
|
|
319
|
-
The package also re-exports a few helpers that are useful when you're composing your own UI:
|
|
320
|
-
|
|
321
|
-
- `userColor(userId)` — deterministic per-user color for sender labels and avatars (8-hue palette, hashed from the id).
|
|
322
|
-
- `computeGroupPosition(msg, prev, next, windowMs)` / `sameDay(a, b)` / `formatDayLabel(iso)` — the same grouping primitives `<ConversationView>` uses to cluster messages.
|
|
323
|
-
- `useAutogrow(ref, value)` — textarea auto-grow hook used by the composers.
|
|
324
|
-
- `handleListEnter(value, caret)` — the smart-list-continuation primitive (handles `- item` / `1. item` continuation on Enter).
|
|
73
|
+
Override the `--poolse-*` CSS variables (`--poolse-brand`,
|
|
74
|
+
`--poolse-brand-soft`, `--poolse-ink`, `--poolse-surface`,
|
|
75
|
+
`--poolse-radius-md`, `--poolse-font-body`, …). Dark mode follows
|
|
76
|
+
`prefers-color-scheme`; force it with `data-theme="dark"` or
|
|
77
|
+
`data-theme="light"` on any ancestor. The full list is in the docs.
|
|
325
78
|
|
|
326
79
|
## Links
|
|
327
80
|
|
|
328
|
-
-
|
|
329
|
-
-
|
|
330
|
-
- SDK reference — [`@poolse/sdk`](https://www.npmjs.com/package/@poolse/sdk)
|
|
331
|
-
- Source — <https://github.com/poolse-hq/js-sdk>
|
|
81
|
+
- Docs: <https://poolse.dev/docs/sdk/react-ui>
|
|
82
|
+
- Source: <https://github.com/poolse-hq/js-sdk>
|
|
332
83
|
|
|
333
84
|
## License
|
|
334
85
|
|
|
335
|
-
|
|
86
|
+
Licensed under the [poolse SDK License](./LICENSE) from 3.0.0; versions
|
|
87
|
+
before 3.0.0 remain MIT.
|