@poolse/react-ui 1.1.0 → 2.0.1
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 +26 -0
- package/README.md +2 -0
- package/dist/index.cjs +37 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -32
- package/dist/index.d.ts +44 -32
- package/dist/index.js +37 -28
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -16,8 +16,13 @@ interface ConversationViewProps {
|
|
|
16
16
|
* actions, attachments inline as configured below).
|
|
17
17
|
*/
|
|
18
18
|
renderMessage?: (msg: Message, currentUserId: string | null) => ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Translate an `external_id` into a display name. Passed through to
|
|
21
|
+
* `MessageBubble`, `TypingIndicator`, `MentionInput`, `MemberList`.
|
|
22
|
+
* Falls back to the SDK's `userResolver` (and then the external_id
|
|
23
|
+
* itself) when omitted.
|
|
24
|
+
*/
|
|
25
|
+
labelFor?: (externalId: string) => string;
|
|
21
26
|
/**
|
|
22
27
|
* Auto-load the brand fonts on mount. Defaults to `true`. Set to
|
|
23
28
|
* `false` when the host app already loads them, or when CSP
|
|
@@ -115,10 +120,10 @@ interface MessageBubbleProps {
|
|
|
115
120
|
readState?: 'sent' | 'read';
|
|
116
121
|
/**
|
|
117
122
|
* Optional friendly label for a quoted message's sender. Same shape
|
|
118
|
-
* as `<MemberList labelFor>` —
|
|
119
|
-
*
|
|
123
|
+
* as `<MemberList labelFor>` — `(externalId) => string` looking up a
|
|
124
|
+
* display name from the local member roster.
|
|
120
125
|
*/
|
|
121
|
-
labelFor?: (
|
|
126
|
+
labelFor?: (externalId: string) => string;
|
|
122
127
|
/**
|
|
123
128
|
* Called when the user clicks the quoted card. Typically used to
|
|
124
129
|
* scroll the chat to the original message + flash a highlight.
|
|
@@ -216,8 +221,8 @@ interface MessageComposerProps {
|
|
|
216
221
|
replyingTo?: Message | null;
|
|
217
222
|
/** User clicked the (x) on the reply chip. Caller clears `replyingTo`. */
|
|
218
223
|
onCancelReply?: () => void;
|
|
219
|
-
/** Friendly display label for the quoted sender
|
|
220
|
-
labelFor?: (
|
|
224
|
+
/** Friendly display label for the quoted sender, keyed by `external_id`. */
|
|
225
|
+
labelFor?: (externalId: string) => string;
|
|
221
226
|
/**
|
|
222
227
|
* Show the paperclip + queue strip + accept dropped files via
|
|
223
228
|
* `ref.current.addFiles(files)`. Default `true`. Set `false` to
|
|
@@ -269,10 +274,14 @@ interface MessageActionsProps {
|
|
|
269
274
|
declare function MessageActions({ onReact, onReply, onQuote, onCopy, onEdit, onDelete, children, }: MessageActionsProps): react_jsx_runtime.JSX.Element;
|
|
270
275
|
|
|
271
276
|
interface TypingIndicatorProps {
|
|
272
|
-
/** Set of
|
|
277
|
+
/** Set of `external_id`s currently typing — what `useTyping` returns. */
|
|
273
278
|
typing: Set<string>;
|
|
274
|
-
/**
|
|
275
|
-
|
|
279
|
+
/**
|
|
280
|
+
* Resolves an `external_id` to a display label. Defaults to the
|
|
281
|
+
* SDK's `userResolver` (and falls back to the external_id itself
|
|
282
|
+
* when the resolver isn't configured).
|
|
283
|
+
*/
|
|
284
|
+
labelFor?: (externalId: string) => string;
|
|
276
285
|
}
|
|
277
286
|
/**
|
|
278
287
|
* Animated 3-dot typing bubble with an inline name label. Hidden
|
|
@@ -312,20 +321,21 @@ interface AvatarProps {
|
|
|
312
321
|
declare function Avatar({ src, name, online, size, className }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
313
322
|
|
|
314
323
|
interface UserNameProps {
|
|
315
|
-
|
|
324
|
+
/** The tenant's user identifier — what your `userResolver` consumes. */
|
|
325
|
+
externalId: string | null | undefined;
|
|
316
326
|
/** Sync override. When set, skips the async resolver entirely. */
|
|
317
|
-
labelFor?: (
|
|
318
|
-
/** What to render when
|
|
327
|
+
labelFor?: (externalId: string) => string;
|
|
328
|
+
/** What to render when `externalId` itself is null (e.g. system messages). */
|
|
319
329
|
emptyFallback?: string;
|
|
320
330
|
className?: string;
|
|
321
331
|
}
|
|
322
|
-
declare function UserName({
|
|
332
|
+
declare function UserName({ externalId, labelFor, emptyFallback, className, }: UserNameProps): react_jsx_runtime.JSX.Element;
|
|
323
333
|
/**
|
|
324
334
|
* Same priority chain as the component but as a plain hook so callers
|
|
325
335
|
* that need the resolved name in a string context (aria-label,
|
|
326
336
|
* tooltip, etc.) don't have to render an extra element.
|
|
327
337
|
*/
|
|
328
|
-
declare function useDisplayName(
|
|
338
|
+
declare function useDisplayName(externalId: string | null | undefined, labelFor?: (externalId: string) => string, emptyFallback?: string): string;
|
|
329
339
|
|
|
330
340
|
interface ConversationListProps {
|
|
331
341
|
/** Currently selected conversation id — sets `aria-current` + selected styling. */
|
|
@@ -361,24 +371,25 @@ declare function ConversationList({ selectedId, onSelect, renderItem, emptyState
|
|
|
361
371
|
interface MemberListProps {
|
|
362
372
|
conversationId: Uuid;
|
|
363
373
|
/**
|
|
364
|
-
* Resolve
|
|
365
|
-
*
|
|
366
|
-
*
|
|
374
|
+
* Resolve an `external_id` to a friendly display name. When omitted,
|
|
375
|
+
* the SDK's `userResolver` is used (and the external_id is shown as
|
|
376
|
+
* a fallback while the resolver loads / returns null).
|
|
367
377
|
*/
|
|
368
|
-
labelFor?: (
|
|
378
|
+
labelFor?: (externalId: string) => string;
|
|
369
379
|
/**
|
|
370
|
-
* Resolve an avatar URL by
|
|
371
|
-
* is used when not provided or when this returns null.
|
|
380
|
+
* Resolve an avatar URL by `external_id`. Optional — initials
|
|
381
|
+
* fallback is used when not provided or when this returns null.
|
|
372
382
|
*/
|
|
373
|
-
avatarFor?: (
|
|
383
|
+
avatarFor?: (externalId: string) => string | null;
|
|
374
384
|
/**
|
|
375
|
-
* Override the online set with a caller-supplied source
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
385
|
+
* Override the online set with a caller-supplied source of
|
|
386
|
+
* `external_id`s. By default MemberList wires
|
|
387
|
+
* `usePresence(conversationId).online` itself, so the presence dots
|
|
388
|
+
* light up out-of-the-box. Pass an explicit `Set` when you want to
|
|
389
|
+
* merge presence with other signals (typing, focus, etc), or an
|
|
390
|
+
* empty `new Set()` to disable the dots entirely.
|
|
380
391
|
*/
|
|
381
|
-
|
|
392
|
+
onlineExternalIds?: Set<string>;
|
|
382
393
|
/**
|
|
383
394
|
* If provided, surfaces a "remove" icon next to each member that
|
|
384
395
|
* the caller is allowed to remove. The caller is responsible for
|
|
@@ -390,7 +401,7 @@ interface MemberListProps {
|
|
|
390
401
|
/** Custom empty state when the conversation has zero members. */
|
|
391
402
|
emptyState?: ReactNode;
|
|
392
403
|
}
|
|
393
|
-
declare function MemberList({ conversationId, labelFor, avatarFor,
|
|
404
|
+
declare function MemberList({ conversationId, labelFor, avatarFor, onlineExternalIds, canRemove, renderItem, emptyState, }: MemberListProps): react_jsx_runtime.JSX.Element;
|
|
394
405
|
|
|
395
406
|
interface AttachmentPreviewProps {
|
|
396
407
|
/**
|
|
@@ -465,10 +476,11 @@ interface MentionInputProps {
|
|
|
465
476
|
placeholder?: string;
|
|
466
477
|
disabled?: boolean;
|
|
467
478
|
/**
|
|
468
|
-
* Resolve a
|
|
469
|
-
* Defaults to the
|
|
479
|
+
* Resolve a member's `external_id` to a display name for the @
|
|
480
|
+
* dropdown. Defaults to the SDK's `userResolver`, falling back to
|
|
481
|
+
* the external_id itself when no resolver is configured.
|
|
470
482
|
*/
|
|
471
|
-
labelFor?: (
|
|
483
|
+
labelFor?: (externalId: string) => string;
|
|
472
484
|
/**
|
|
473
485
|
* Caller-owned "I'm replying to this message" state. Mirrors
|
|
474
486
|
* `<MessageComposer replyingTo>` — renders a quote chip above the
|
package/dist/index.d.ts
CHANGED
|
@@ -16,8 +16,13 @@ interface ConversationViewProps {
|
|
|
16
16
|
* actions, attachments inline as configured below).
|
|
17
17
|
*/
|
|
18
18
|
renderMessage?: (msg: Message, currentUserId: string | null) => ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Translate an `external_id` into a display name. Passed through to
|
|
21
|
+
* `MessageBubble`, `TypingIndicator`, `MentionInput`, `MemberList`.
|
|
22
|
+
* Falls back to the SDK's `userResolver` (and then the external_id
|
|
23
|
+
* itself) when omitted.
|
|
24
|
+
*/
|
|
25
|
+
labelFor?: (externalId: string) => string;
|
|
21
26
|
/**
|
|
22
27
|
* Auto-load the brand fonts on mount. Defaults to `true`. Set to
|
|
23
28
|
* `false` when the host app already loads them, or when CSP
|
|
@@ -115,10 +120,10 @@ interface MessageBubbleProps {
|
|
|
115
120
|
readState?: 'sent' | 'read';
|
|
116
121
|
/**
|
|
117
122
|
* Optional friendly label for a quoted message's sender. Same shape
|
|
118
|
-
* as `<MemberList labelFor>` —
|
|
119
|
-
*
|
|
123
|
+
* as `<MemberList labelFor>` — `(externalId) => string` looking up a
|
|
124
|
+
* display name from the local member roster.
|
|
120
125
|
*/
|
|
121
|
-
labelFor?: (
|
|
126
|
+
labelFor?: (externalId: string) => string;
|
|
122
127
|
/**
|
|
123
128
|
* Called when the user clicks the quoted card. Typically used to
|
|
124
129
|
* scroll the chat to the original message + flash a highlight.
|
|
@@ -216,8 +221,8 @@ interface MessageComposerProps {
|
|
|
216
221
|
replyingTo?: Message | null;
|
|
217
222
|
/** User clicked the (x) on the reply chip. Caller clears `replyingTo`. */
|
|
218
223
|
onCancelReply?: () => void;
|
|
219
|
-
/** Friendly display label for the quoted sender
|
|
220
|
-
labelFor?: (
|
|
224
|
+
/** Friendly display label for the quoted sender, keyed by `external_id`. */
|
|
225
|
+
labelFor?: (externalId: string) => string;
|
|
221
226
|
/**
|
|
222
227
|
* Show the paperclip + queue strip + accept dropped files via
|
|
223
228
|
* `ref.current.addFiles(files)`. Default `true`. Set `false` to
|
|
@@ -269,10 +274,14 @@ interface MessageActionsProps {
|
|
|
269
274
|
declare function MessageActions({ onReact, onReply, onQuote, onCopy, onEdit, onDelete, children, }: MessageActionsProps): react_jsx_runtime.JSX.Element;
|
|
270
275
|
|
|
271
276
|
interface TypingIndicatorProps {
|
|
272
|
-
/** Set of
|
|
277
|
+
/** Set of `external_id`s currently typing — what `useTyping` returns. */
|
|
273
278
|
typing: Set<string>;
|
|
274
|
-
/**
|
|
275
|
-
|
|
279
|
+
/**
|
|
280
|
+
* Resolves an `external_id` to a display label. Defaults to the
|
|
281
|
+
* SDK's `userResolver` (and falls back to the external_id itself
|
|
282
|
+
* when the resolver isn't configured).
|
|
283
|
+
*/
|
|
284
|
+
labelFor?: (externalId: string) => string;
|
|
276
285
|
}
|
|
277
286
|
/**
|
|
278
287
|
* Animated 3-dot typing bubble with an inline name label. Hidden
|
|
@@ -312,20 +321,21 @@ interface AvatarProps {
|
|
|
312
321
|
declare function Avatar({ src, name, online, size, className }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
313
322
|
|
|
314
323
|
interface UserNameProps {
|
|
315
|
-
|
|
324
|
+
/** The tenant's user identifier — what your `userResolver` consumes. */
|
|
325
|
+
externalId: string | null | undefined;
|
|
316
326
|
/** Sync override. When set, skips the async resolver entirely. */
|
|
317
|
-
labelFor?: (
|
|
318
|
-
/** What to render when
|
|
327
|
+
labelFor?: (externalId: string) => string;
|
|
328
|
+
/** What to render when `externalId` itself is null (e.g. system messages). */
|
|
319
329
|
emptyFallback?: string;
|
|
320
330
|
className?: string;
|
|
321
331
|
}
|
|
322
|
-
declare function UserName({
|
|
332
|
+
declare function UserName({ externalId, labelFor, emptyFallback, className, }: UserNameProps): react_jsx_runtime.JSX.Element;
|
|
323
333
|
/**
|
|
324
334
|
* Same priority chain as the component but as a plain hook so callers
|
|
325
335
|
* that need the resolved name in a string context (aria-label,
|
|
326
336
|
* tooltip, etc.) don't have to render an extra element.
|
|
327
337
|
*/
|
|
328
|
-
declare function useDisplayName(
|
|
338
|
+
declare function useDisplayName(externalId: string | null | undefined, labelFor?: (externalId: string) => string, emptyFallback?: string): string;
|
|
329
339
|
|
|
330
340
|
interface ConversationListProps {
|
|
331
341
|
/** Currently selected conversation id — sets `aria-current` + selected styling. */
|
|
@@ -361,24 +371,25 @@ declare function ConversationList({ selectedId, onSelect, renderItem, emptyState
|
|
|
361
371
|
interface MemberListProps {
|
|
362
372
|
conversationId: Uuid;
|
|
363
373
|
/**
|
|
364
|
-
* Resolve
|
|
365
|
-
*
|
|
366
|
-
*
|
|
374
|
+
* Resolve an `external_id` to a friendly display name. When omitted,
|
|
375
|
+
* the SDK's `userResolver` is used (and the external_id is shown as
|
|
376
|
+
* a fallback while the resolver loads / returns null).
|
|
367
377
|
*/
|
|
368
|
-
labelFor?: (
|
|
378
|
+
labelFor?: (externalId: string) => string;
|
|
369
379
|
/**
|
|
370
|
-
* Resolve an avatar URL by
|
|
371
|
-
* is used when not provided or when this returns null.
|
|
380
|
+
* Resolve an avatar URL by `external_id`. Optional — initials
|
|
381
|
+
* fallback is used when not provided or when this returns null.
|
|
372
382
|
*/
|
|
373
|
-
avatarFor?: (
|
|
383
|
+
avatarFor?: (externalId: string) => string | null;
|
|
374
384
|
/**
|
|
375
|
-
* Override the online set with a caller-supplied source
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
385
|
+
* Override the online set with a caller-supplied source of
|
|
386
|
+
* `external_id`s. By default MemberList wires
|
|
387
|
+
* `usePresence(conversationId).online` itself, so the presence dots
|
|
388
|
+
* light up out-of-the-box. Pass an explicit `Set` when you want to
|
|
389
|
+
* merge presence with other signals (typing, focus, etc), or an
|
|
390
|
+
* empty `new Set()` to disable the dots entirely.
|
|
380
391
|
*/
|
|
381
|
-
|
|
392
|
+
onlineExternalIds?: Set<string>;
|
|
382
393
|
/**
|
|
383
394
|
* If provided, surfaces a "remove" icon next to each member that
|
|
384
395
|
* the caller is allowed to remove. The caller is responsible for
|
|
@@ -390,7 +401,7 @@ interface MemberListProps {
|
|
|
390
401
|
/** Custom empty state when the conversation has zero members. */
|
|
391
402
|
emptyState?: ReactNode;
|
|
392
403
|
}
|
|
393
|
-
declare function MemberList({ conversationId, labelFor, avatarFor,
|
|
404
|
+
declare function MemberList({ conversationId, labelFor, avatarFor, onlineExternalIds, canRemove, renderItem, emptyState, }: MemberListProps): react_jsx_runtime.JSX.Element;
|
|
394
405
|
|
|
395
406
|
interface AttachmentPreviewProps {
|
|
396
407
|
/**
|
|
@@ -465,10 +476,11 @@ interface MentionInputProps {
|
|
|
465
476
|
placeholder?: string;
|
|
466
477
|
disabled?: boolean;
|
|
467
478
|
/**
|
|
468
|
-
* Resolve a
|
|
469
|
-
* Defaults to the
|
|
479
|
+
* Resolve a member's `external_id` to a display name for the @
|
|
480
|
+
* dropdown. Defaults to the SDK's `userResolver`, falling back to
|
|
481
|
+
* the external_id itself when no resolver is configured.
|
|
470
482
|
*/
|
|
471
|
-
labelFor?: (
|
|
483
|
+
labelFor?: (externalId: string) => string;
|
|
472
484
|
/**
|
|
473
485
|
* Caller-owned "I'm replying to this message" state. Mirrors
|
|
474
486
|
* `<MessageComposer replyingTo>` — renders a quote chip above the
|
package/dist/index.js
CHANGED
|
@@ -382,24 +382,24 @@ function UploadChip({
|
|
|
382
382
|
}
|
|
383
383
|
var MAX_NAME_CHARS = 24;
|
|
384
384
|
function UserName({
|
|
385
|
-
|
|
385
|
+
externalId,
|
|
386
386
|
labelFor,
|
|
387
387
|
emptyFallback = "Unknown",
|
|
388
388
|
className
|
|
389
389
|
}) {
|
|
390
|
-
const { profile } = useUser(labelFor ? null :
|
|
391
|
-
const name = resolveDisplayName(
|
|
390
|
+
const { profile } = useUser(labelFor ? null : externalId);
|
|
391
|
+
const name = resolveDisplayName(externalId, profile?.displayName, labelFor, emptyFallback);
|
|
392
392
|
return /* @__PURE__ */ jsx("span", { className, children: truncate(name) });
|
|
393
393
|
}
|
|
394
|
-
function useDisplayName(
|
|
395
|
-
const { profile } = useUser(labelFor ? null :
|
|
396
|
-
return resolveDisplayName(
|
|
394
|
+
function useDisplayName(externalId, labelFor, emptyFallback = "Unknown") {
|
|
395
|
+
const { profile } = useUser(labelFor ? null : externalId);
|
|
396
|
+
return resolveDisplayName(externalId, profile?.displayName, labelFor, emptyFallback);
|
|
397
397
|
}
|
|
398
|
-
function resolveDisplayName(
|
|
399
|
-
if (!
|
|
400
|
-
if (labelFor) return labelFor(
|
|
398
|
+
function resolveDisplayName(externalId, resolved, labelFor, emptyFallback) {
|
|
399
|
+
if (!externalId) return emptyFallback;
|
|
400
|
+
if (labelFor) return labelFor(externalId);
|
|
401
401
|
if (resolved) return resolved;
|
|
402
|
-
return
|
|
402
|
+
return externalId;
|
|
403
403
|
}
|
|
404
404
|
function truncate(s) {
|
|
405
405
|
if (s.length <= MAX_NAME_CHARS) return s;
|
|
@@ -451,8 +451,10 @@ var MentionInput = forwardRef(
|
|
|
451
451
|
});
|
|
452
452
|
};
|
|
453
453
|
useImperativeHandle(ref, () => ({ addFiles }), [addFiles, attachments]);
|
|
454
|
-
const label = labelFor ?? ((id) => id
|
|
455
|
-
const filtered = mention ? members.filter(
|
|
454
|
+
const label = labelFor ?? ((id) => id);
|
|
455
|
+
const filtered = mention ? members.filter(
|
|
456
|
+
(m) => label(m.external_id).toLowerCase().includes(mention.query.toLowerCase())
|
|
457
|
+
) : [];
|
|
456
458
|
useEffect(() => {
|
|
457
459
|
setActiveIdx(0);
|
|
458
460
|
}, [filtered.length, mention?.query]);
|
|
@@ -479,7 +481,7 @@ var MentionInput = forwardRef(
|
|
|
479
481
|
};
|
|
480
482
|
const insertMention = (m) => {
|
|
481
483
|
if (!mention) return;
|
|
482
|
-
const name = label(m.
|
|
484
|
+
const name = label(m.external_id);
|
|
483
485
|
const before = value.slice(0, mention.start);
|
|
484
486
|
const after = value.slice(mention.start + 1 + mention.query.length);
|
|
485
487
|
const inserted = `@${name} `;
|
|
@@ -561,7 +563,7 @@ var MentionInput = forwardRef(
|
|
|
561
563
|
onCancelReply();
|
|
562
564
|
}
|
|
563
565
|
};
|
|
564
|
-
const replyLabel = replyingTo?.
|
|
566
|
+
const replyLabel = replyingTo?.sender_external_id ? labelFor?.(replyingTo.sender_external_id) ?? replyingTo.sender_external_id : "Unknown";
|
|
565
567
|
const canSend = !disabled && !sending && !uploading && (value.trim() !== "" || readyCount > 0);
|
|
566
568
|
return /* @__PURE__ */ jsxs(
|
|
567
569
|
"form",
|
|
@@ -681,7 +683,7 @@ var MentionInput = forwardRef(
|
|
|
681
683
|
},
|
|
682
684
|
children: [
|
|
683
685
|
/* @__PURE__ */ jsx("span", { children: "@" }),
|
|
684
|
-
/* @__PURE__ */ jsx(UserName, {
|
|
686
|
+
/* @__PURE__ */ jsx(UserName, { externalId: m.external_id, ...labelFor ? { labelFor } : {} })
|
|
685
687
|
]
|
|
686
688
|
},
|
|
687
689
|
m.id
|
|
@@ -860,7 +862,7 @@ function ReplyChip({
|
|
|
860
862
|
labelFor,
|
|
861
863
|
onCancel
|
|
862
864
|
}) {
|
|
863
|
-
const senderLabel = message.
|
|
865
|
+
const senderLabel = message.sender_external_id ? labelFor?.(message.sender_external_id) ?? message.sender_external_id : "Unknown";
|
|
864
866
|
const preview = message.body ?? "";
|
|
865
867
|
return /* @__PURE__ */ jsxs("div", { className: "poolse-composer__reply", role: "status", children: [
|
|
866
868
|
/* @__PURE__ */ jsxs("div", { className: "poolse-composer__reply-body", children: [
|
|
@@ -1106,10 +1108,11 @@ function MessageBubble({
|
|
|
1106
1108
|
}) {
|
|
1107
1109
|
const isSelf = currentUserId !== null && message.sender_id === currentUserId;
|
|
1108
1110
|
const [expanded, setExpanded] = useState(false);
|
|
1109
|
-
const { profile: sender } = useUser(!isSelf ? message.
|
|
1110
|
-
const senderFallbackName = message.
|
|
1111
|
+
const { profile: sender } = useUser(!isSelf ? message.sender_external_id : null);
|
|
1112
|
+
const senderFallbackName = message.sender_external_id ?? "Unknown";
|
|
1111
1113
|
const senderName = sender?.displayName ?? senderFallbackName;
|
|
1112
|
-
const
|
|
1114
|
+
const senderColorKey = message.sender_external_id ?? message.sender_id ?? "";
|
|
1115
|
+
const senderColorHex = senderColorKey ? userColor(senderColorKey) : "currentColor";
|
|
1113
1116
|
const renderSenderName = showSenderName && !isSelf && (groupPosition === "first" || groupPosition === "standalone");
|
|
1114
1117
|
const rawBody = message.body ?? "";
|
|
1115
1118
|
const TRIM_BUFFER = 40;
|
|
@@ -1258,7 +1261,7 @@ function QuotedCard({
|
|
|
1258
1261
|
labelFor,
|
|
1259
1262
|
onClick
|
|
1260
1263
|
}) {
|
|
1261
|
-
const senderLabel = quoted.
|
|
1264
|
+
const senderLabel = quoted.sender_external_id ? labelFor?.(quoted.sender_external_id) ?? quoted.sender_external_id : "Unknown";
|
|
1262
1265
|
const isDeleted = !!quoted.deleted_at;
|
|
1263
1266
|
const handleClick = onClick ? () => onClick(quoted.id) : void 0;
|
|
1264
1267
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1927,7 +1930,10 @@ function TypingIndicator({ typing, labelFor }) {
|
|
|
1927
1930
|
/* @__PURE__ */ jsx("span", { className: "poolse-typing__label", role: "status", "aria-live": "polite", "aria-atomic": "true", children: isTyping ? /* @__PURE__ */ jsx(TypingLabel, { ids, ...labelFor ? { labelFor } : {} }) : "" })
|
|
1928
1931
|
] });
|
|
1929
1932
|
}
|
|
1930
|
-
function TypingLabel({
|
|
1933
|
+
function TypingLabel({
|
|
1934
|
+
ids,
|
|
1935
|
+
labelFor
|
|
1936
|
+
}) {
|
|
1931
1937
|
const id1 = ids[0] ?? null;
|
|
1932
1938
|
const id2 = ids[1] ?? null;
|
|
1933
1939
|
const name1 = useDisplayName(id1, labelFor);
|
|
@@ -2225,6 +2231,7 @@ function ConversationView({
|
|
|
2225
2231
|
quoted_message: {
|
|
2226
2232
|
id: original.id,
|
|
2227
2233
|
sender_id: original.sender_id,
|
|
2234
|
+
sender_external_id: original.sender_external_id,
|
|
2228
2235
|
body: original.body,
|
|
2229
2236
|
deleted_at: original.deleted_at,
|
|
2230
2237
|
inserted_at: original.inserted_at
|
|
@@ -2398,14 +2405,16 @@ function MemberList({
|
|
|
2398
2405
|
conversationId,
|
|
2399
2406
|
labelFor,
|
|
2400
2407
|
avatarFor,
|
|
2401
|
-
|
|
2408
|
+
onlineExternalIds,
|
|
2402
2409
|
canRemove,
|
|
2403
2410
|
renderItem,
|
|
2404
2411
|
emptyState
|
|
2405
2412
|
}) {
|
|
2406
2413
|
const { members, loading, error, removeMember } = useMembers(conversationId);
|
|
2407
|
-
const { online: presenceOnline } = usePresence(
|
|
2408
|
-
|
|
2414
|
+
const { online: presenceOnline } = usePresence(
|
|
2415
|
+
onlineExternalIds === void 0 ? conversationId : ""
|
|
2416
|
+
);
|
|
2417
|
+
const effectiveOnline = onlineExternalIds ?? presenceOnline;
|
|
2409
2418
|
if (loading && members.length === 0) {
|
|
2410
2419
|
return /* @__PURE__ */ jsx("div", { className: "poolse-list poolse-list--placeholder", children: "Loading members\u2026" });
|
|
2411
2420
|
}
|
|
@@ -2423,11 +2432,11 @@ function MemberList({
|
|
|
2423
2432
|
DefaultMemberRow,
|
|
2424
2433
|
{
|
|
2425
2434
|
membership: m,
|
|
2426
|
-
avatarUrl: avatarFor?.(m.
|
|
2427
|
-
online: effectiveOnline.has(m.
|
|
2435
|
+
avatarUrl: avatarFor?.(m.external_id) ?? null,
|
|
2436
|
+
online: effectiveOnline.has(m.external_id),
|
|
2428
2437
|
removable: canRemove?.(m) ?? false,
|
|
2429
2438
|
onRemove: () => {
|
|
2430
|
-
void removeMember(m.
|
|
2439
|
+
void removeMember(m.external_id);
|
|
2431
2440
|
},
|
|
2432
2441
|
...labelFor ? { labelFor } : {}
|
|
2433
2442
|
}
|
|
@@ -2443,7 +2452,7 @@ function DefaultMemberRow({
|
|
|
2443
2452
|
onRemove,
|
|
2444
2453
|
labelFor
|
|
2445
2454
|
}) {
|
|
2446
|
-
const name = useDisplayName(membership.
|
|
2455
|
+
const name = useDisplayName(membership.external_id, labelFor);
|
|
2447
2456
|
return /* @__PURE__ */ jsxs("div", { className: "poolse-member-row", children: [
|
|
2448
2457
|
/* @__PURE__ */ jsx(Avatar, { src: avatarUrl, name, online, size: "md" }),
|
|
2449
2458
|
/* @__PURE__ */ jsxs("div", { className: "poolse-member-row__body", children: [
|