@poolse/react-ui 1.0.0-rc.0 → 1.0.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 +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -334,8 +334,11 @@ interface MemberListProps {
|
|
|
334
334
|
*/
|
|
335
335
|
avatarFor?: (userId: Uuid) => string | null;
|
|
336
336
|
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
337
|
+
* Override the online set with a caller-supplied source. By default
|
|
338
|
+
* MemberList wires `usePresence(conversationId).online` itself, so the
|
|
339
|
+
* presence dots light up out-of-the-box. Pass an explicit `Set` when
|
|
340
|
+
* you want to merge presence with other signals (typing, focus, etc),
|
|
341
|
+
* or an empty `new Set()` to disable the dots entirely.
|
|
339
342
|
*/
|
|
340
343
|
onlineUserIds?: Set<Uuid>;
|
|
341
344
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -334,8 +334,11 @@ interface MemberListProps {
|
|
|
334
334
|
*/
|
|
335
335
|
avatarFor?: (userId: Uuid) => string | null;
|
|
336
336
|
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
337
|
+
* Override the online set with a caller-supplied source. By default
|
|
338
|
+
* MemberList wires `usePresence(conversationId).online` itself, so the
|
|
339
|
+
* presence dots light up out-of-the-box. Pass an explicit `Set` when
|
|
340
|
+
* you want to merge presence with other signals (typing, focus, etc),
|
|
341
|
+
* or an empty `new Set()` to disable the dots entirely.
|
|
339
342
|
*/
|
|
340
343
|
onlineUserIds?: Set<Uuid>;
|
|
341
344
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useUser, useMembers, useAttachmentUrl, useReactions, useMe, useThread, useMessages, useTyping, useRealtimeStatus, useAttachmentUpload, useConversations } from '@poolse/react';
|
|
2
|
+
import { useUser, useMembers, useAttachmentUrl, useReactions, useMe, useThread, useMessages, useTyping, useRealtimeStatus, useAttachmentUpload, useConversations, usePresence } from '@poolse/react';
|
|
3
3
|
import { useEffect, useState, useRef, Fragment as Fragment$1, useMemo } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import ReactMarkdown from 'react-markdown';
|
|
@@ -2172,6 +2172,10 @@ function MemberList({
|
|
|
2172
2172
|
emptyState
|
|
2173
2173
|
}) {
|
|
2174
2174
|
const { members, loading, error, removeMember } = useMembers(conversationId);
|
|
2175
|
+
const { online: presenceOnline } = usePresence(
|
|
2176
|
+
onlineUserIds === void 0 ? conversationId : ""
|
|
2177
|
+
);
|
|
2178
|
+
const effectiveOnline = onlineUserIds ?? presenceOnline;
|
|
2175
2179
|
if (loading && members.length === 0) {
|
|
2176
2180
|
return /* @__PURE__ */ jsx("div", { className: "poolse-list poolse-list--placeholder", children: "Loading members\u2026" });
|
|
2177
2181
|
}
|
|
@@ -2190,7 +2194,7 @@ function MemberList({
|
|
|
2190
2194
|
{
|
|
2191
2195
|
membership: m,
|
|
2192
2196
|
avatarUrl: avatarFor?.(m.user_id) ?? null,
|
|
2193
|
-
online:
|
|
2197
|
+
online: effectiveOnline.has(m.user_id),
|
|
2194
2198
|
removable: canRemove?.(m) ?? false,
|
|
2195
2199
|
onRemove: () => {
|
|
2196
2200
|
void removeMember(m.user_id);
|