@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 +73 -0
- package/README.md +53 -2
- package/dist/index.cjs +757 -178
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +274 -97
- package/dist/index.d.ts +274 -97
- package/dist/index.js +738 -181
- package/dist/index.js.map +1 -1
- package/dist/styles.css +415 -7
- package/package.json +12 -11
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { CallParticipant, CallDevice, CallDeviceKind,
|
|
2
|
+
import { CallParticipant, CallDevice, CallDeviceKind, Message, Uuid, LiveCall, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { SVGProps, ReactElement, ReactNode } from 'react';
|
|
5
|
-
import { UseRoom, UploadItem, ReactionMap } from '@poolse/react';
|
|
4
|
+
import { SVGProps, ReactElement, ReactNode, CSSProperties } from 'react';
|
|
5
|
+
import { GroupPosition, UseRoom, UploadItem, ReactionMap } from '@poolse/react';
|
|
6
|
+
import { ThemeInput, ColorSchemePreference, ResolvedTheme, ColorScheme } from '@poolse/theme';
|
|
7
|
+
export { BUILT_IN_THEME_IDS, BuiltInThemeId, ColorScheme, ColorSchemePreference, DEFAULT_THEME_ID, Theme, ThemeInput, createTheme, decodeTheme, encodeTheme } from '@poolse/theme';
|
|
6
8
|
|
|
7
9
|
interface CallVideoGridProps {
|
|
8
10
|
participants: CallParticipant[];
|
|
@@ -337,6 +339,169 @@ interface CallDeviceMenuProps {
|
|
|
337
339
|
*/
|
|
338
340
|
declare function CallDeviceMenu({ title, devices, activeId, onSelect, onClose, }: CallDeviceMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
339
341
|
|
|
342
|
+
/**
|
|
343
|
+
* Position of this bubble within a same-sender, same-day, ≤5-min
|
|
344
|
+
* cluster. Drives the tail-corner rendering: only `last` and
|
|
345
|
+
* `standalone` get the asymmetric tail, matching the WhatsApp /
|
|
346
|
+
* iMessage convention where consecutive bursts read as a single
|
|
347
|
+
* unit with one trailing tail.
|
|
348
|
+
*/
|
|
349
|
+
type BubbleGroupPosition = 'first' | 'middle' | 'last' | 'standalone';
|
|
350
|
+
interface MessageBubbleProps {
|
|
351
|
+
message: Message;
|
|
352
|
+
/** Used to decide left/right alignment + color, and whether to show the read-receipt glyph. */
|
|
353
|
+
currentUserId: string | null;
|
|
354
|
+
/**
|
|
355
|
+
* Show the read-receipt check-double on self-sent messages. Pass
|
|
356
|
+
* `true` when at least one other member's `last_read_message_id`
|
|
357
|
+
* is >= this message's sequence. Single-tick + double-tick variants
|
|
358
|
+
* map to "sent" and "read" respectively per brand conventions.
|
|
359
|
+
*/
|
|
360
|
+
readState?: 'sent' | 'read';
|
|
361
|
+
/**
|
|
362
|
+
* Optional friendly label for a quoted message's sender. Same shape
|
|
363
|
+
* as `<MemberList labelFor>` — `(externalId) => string` looking up a
|
|
364
|
+
* display name from the local member roster.
|
|
365
|
+
*/
|
|
366
|
+
labelFor?: (externalId: string) => string;
|
|
367
|
+
/**
|
|
368
|
+
* Called when the user clicks the quoted card. Typically used to
|
|
369
|
+
* scroll the chat to the original message + flash a highlight.
|
|
370
|
+
* No-op when omitted.
|
|
371
|
+
*/
|
|
372
|
+
onQuotedClick?: (quotedMessageId: Uuid) => void;
|
|
373
|
+
/**
|
|
374
|
+
* Where this bubble sits within a same-sender cluster (see
|
|
375
|
+
* BubbleGroupPosition). Defaults to `standalone`.
|
|
376
|
+
*/
|
|
377
|
+
groupPosition?: BubbleGroupPosition;
|
|
378
|
+
/**
|
|
379
|
+
* When > 0, truncates the body at this many characters and shows a
|
|
380
|
+
* "Read more" toggle to expand. Defaults to 0 (no truncation).
|
|
381
|
+
*/
|
|
382
|
+
maxBodyLength?: number;
|
|
383
|
+
/**
|
|
384
|
+
* Render the body as GitHub-flavored Markdown (bold, italic, lists,
|
|
385
|
+
* fenced code, blockquotes, strikethrough, autolinks). Defaults to
|
|
386
|
+
* `false`. `<ConversationView>` flips this on by default.
|
|
387
|
+
*/
|
|
388
|
+
markdown?: boolean;
|
|
389
|
+
/**
|
|
390
|
+
* Show a colored sender label above the body for other-side
|
|
391
|
+
* bubbles. Only meaningful in group chats (3+ participants) and
|
|
392
|
+
* only on the FIRST / STANDALONE bubble of a cluster (continuation
|
|
393
|
+
* bubbles share the cluster's identity). The label name comes
|
|
394
|
+
* from the SDK's `useUser` hook via the customer's
|
|
395
|
+
* `userResolver` config.
|
|
396
|
+
*/
|
|
397
|
+
showSenderName?: boolean;
|
|
398
|
+
/**
|
|
399
|
+
* Makes the sender label (see `showSenderName`) a button — e.g. to
|
|
400
|
+
* open the sender's profile.
|
|
401
|
+
*/
|
|
402
|
+
onSenderPress?: () => void;
|
|
403
|
+
/**
|
|
404
|
+
* Slot for a "show actions" affordance — typically a chevron
|
|
405
|
+
* rendered by `<MessageRow>` that toggles the actions popover on
|
|
406
|
+
* desktop click. Positioned absolutely at the top-trailing corner
|
|
407
|
+
* inside the bubble so it overlays the message border; hidden by
|
|
408
|
+
* CSS until the row is hovered.
|
|
409
|
+
*/
|
|
410
|
+
actionsTrigger?: ReactNode;
|
|
411
|
+
/**
|
|
412
|
+
* Render the message's attachments INSIDE the bubble (WhatsApp-
|
|
413
|
+
* style): images mosaic at the top, file cards below, then the
|
|
414
|
+
* message body. Defaults to `true`. Pass `false` if you're rendering
|
|
415
|
+
* attachments yourself outside the bubble.
|
|
416
|
+
*/
|
|
417
|
+
showAttachments?: boolean;
|
|
418
|
+
/** `'12h'`, `'24h'` or a formatter for the timestamp. Defaults to the locale's. */
|
|
419
|
+
timeFormat?: TimeFormat;
|
|
420
|
+
/**
|
|
421
|
+
* Replace or wrap the `header` (sender label), `attachments` and
|
|
422
|
+
* `body` parts. Needs `slotContext` (MessageRow passes both).
|
|
423
|
+
*/
|
|
424
|
+
slots?: MessageSlots;
|
|
425
|
+
slotContext?: MessageSlotContext;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* One message bubble. The default renderer for `<ConversationView>` —
|
|
429
|
+
* customers swap it out via `renderMessage` for full visual control
|
|
430
|
+
* without rebuilding the rest of the chat.
|
|
431
|
+
*
|
|
432
|
+
* Styling: 16px radius bubble with a 5px tail on the sender's side
|
|
433
|
+
* (coral for self, surface-with-border for others), matching the
|
|
434
|
+
* brand-kit chat showcase.
|
|
435
|
+
*/
|
|
436
|
+
declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, markdown, showSenderName, onSenderPress, actionsTrigger, showAttachments, timeFormat, slots, slotContext, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
437
|
+
|
|
438
|
+
/** Who sent a message — what `onSenderPress` / `onAvatarPress` receive. */
|
|
439
|
+
interface MessageUser {
|
|
440
|
+
/** poolse user id. */
|
|
441
|
+
userId: Uuid | null;
|
|
442
|
+
/** Your own user id (`external_id`) — what `userResolver` takes. */
|
|
443
|
+
externalId: string | null;
|
|
444
|
+
/** Resolved name, or the fallback shown in its place. */
|
|
445
|
+
displayName: string;
|
|
446
|
+
avatarUrl: string | null;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* - `bubbles` — chat bubbles, own messages on the right (the default).
|
|
451
|
+
* - `list` — Slack-style full-width rows: avatar, name and time once
|
|
452
|
+
* per run of messages, a hover toolbar.
|
|
453
|
+
* - `compact` — Discord/IRC-style dense lines: time, coloured name and
|
|
454
|
+
* text on one line.
|
|
455
|
+
*/
|
|
456
|
+
type ChatLayout = 'bubbles' | 'list' | 'compact';
|
|
457
|
+
type ChatDensity = 'comfortable' | 'compact';
|
|
458
|
+
/** `'12h'`, `'24h'`, or your own formatter. Omitted: the locale's default. */
|
|
459
|
+
type TimeFormat = '12h' | '24h' | ((date: Date) => string);
|
|
460
|
+
/** What each slot function receives. */
|
|
461
|
+
interface MessageSlotProps {
|
|
462
|
+
message: Message;
|
|
463
|
+
/** The viewer sent it. */
|
|
464
|
+
isSelf: boolean;
|
|
465
|
+
sender: MessageUser;
|
|
466
|
+
layout: ChatLayout;
|
|
467
|
+
/** First message of a same-sender run (always true in `compact`). */
|
|
468
|
+
isRunStart: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* What the slot renders by default (may be `null` — e.g. no header on
|
|
471
|
+
* a continuation message). Return it to keep the default, wrap it,
|
|
472
|
+
* or return something else.
|
|
473
|
+
*/
|
|
474
|
+
children: ReactNode;
|
|
475
|
+
}
|
|
476
|
+
type MessageSlot = (props: MessageSlotProps) => ReactNode;
|
|
477
|
+
/**
|
|
478
|
+
* Replace or wrap one part of every message, in any layout:
|
|
479
|
+
*
|
|
480
|
+
* - `header` — sender name and time (the name label in `bubbles`)
|
|
481
|
+
* - `body` — the text (or "Message deleted")
|
|
482
|
+
* - `attachments` — images and files
|
|
483
|
+
* - `reactions` — the reaction pills
|
|
484
|
+
* - `thread` — the "N replies" link
|
|
485
|
+
* - `actions` — the hover toolbar / actions popover
|
|
486
|
+
*/
|
|
487
|
+
interface MessageSlots {
|
|
488
|
+
header?: MessageSlot;
|
|
489
|
+
body?: MessageSlot;
|
|
490
|
+
attachments?: MessageSlot;
|
|
491
|
+
reactions?: MessageSlot;
|
|
492
|
+
thread?: MessageSlot;
|
|
493
|
+
actions?: MessageSlot;
|
|
494
|
+
}
|
|
495
|
+
type MessageSlotContext = Omit<MessageSlotProps, 'children'>;
|
|
496
|
+
/** Third argument to `renderMessage`. */
|
|
497
|
+
interface RenderMessageContext {
|
|
498
|
+
layout: ChatLayout;
|
|
499
|
+
groupPosition: GroupPosition;
|
|
500
|
+
isRunStart: boolean;
|
|
501
|
+
/** The row ConversationView would have rendered for this message. */
|
|
502
|
+
renderDefault: () => ReactNode;
|
|
503
|
+
}
|
|
504
|
+
|
|
340
505
|
interface ConversationViewProps {
|
|
341
506
|
conversationId: Uuid;
|
|
342
507
|
/** Placeholder when there are no messages. */
|
|
@@ -346,9 +511,44 @@ interface ConversationViewProps {
|
|
|
346
511
|
* COMPLETELY overrides the default per-message rendering — you
|
|
347
512
|
* get the raw message + currentUserId and own the bubble shape.
|
|
348
513
|
* Leave unset to use the brand-aligned defaults (with reactions,
|
|
349
|
-
* actions, attachments inline as configured below).
|
|
514
|
+
* actions, attachments inline as configured below). The third
|
|
515
|
+
* argument carries the layout and `renderDefault()`, the row this
|
|
516
|
+
* view would have drawn — return it for the messages you don't
|
|
517
|
+
* want to change.
|
|
350
518
|
*/
|
|
351
|
-
renderMessage?: (msg: Message, currentUserId: string | null) => ReactNode;
|
|
519
|
+
renderMessage?: (msg: Message, currentUserId: string | null, context: RenderMessageContext) => ReactNode;
|
|
520
|
+
/**
|
|
521
|
+
* How messages are drawn:
|
|
522
|
+
* * `'bubbles'` (default) — chat bubbles, yours on the right.
|
|
523
|
+
* * `'list'` — Slack-style full-width rows; avatar, name and time
|
|
524
|
+
* once per run, the time on hover for the rest, a hover toolbar
|
|
525
|
+
* (React · Reply · Thread · More), "N replies" under threads.
|
|
526
|
+
* * `'compact'` — Discord/IRC-style dense lines: time at the left,
|
|
527
|
+
* the name in the sender's colour, an accent bar on messages
|
|
528
|
+
* that mention you.
|
|
529
|
+
*/
|
|
530
|
+
layout?: ChatLayout;
|
|
531
|
+
/** `'comfortable'` (default) or `'compact'` spacing, in any layout. */
|
|
532
|
+
density?: ChatDensity;
|
|
533
|
+
/**
|
|
534
|
+
* Show avatars. Defaults: `list` on, `compact` off, `bubbles` per
|
|
535
|
+
* `avatars` (others' messages in group chats). Overrides `avatars`.
|
|
536
|
+
*/
|
|
537
|
+
showAvatars?: boolean;
|
|
538
|
+
/** `'12h'`, `'24h'` or a formatter. Defaults to the locale's. */
|
|
539
|
+
timeFormat?: TimeFormat;
|
|
540
|
+
/**
|
|
541
|
+
* Same-sender messages less than this many minutes apart form one
|
|
542
|
+
* run (one bubble cluster, one `list` header). Default 5.
|
|
543
|
+
*/
|
|
544
|
+
groupWindowMinutes?: number;
|
|
545
|
+
/**
|
|
546
|
+
* Replace or wrap one part of every message — `header`, `body`,
|
|
547
|
+
* `attachments`, `reactions`, `thread`, `actions` — in any layout.
|
|
548
|
+
* Each receives the message, sender, layout and its default
|
|
549
|
+
* rendering as `children`.
|
|
550
|
+
*/
|
|
551
|
+
slots?: MessageSlots;
|
|
352
552
|
/**
|
|
353
553
|
* Translate an `external_id` into a display name. Passed through to
|
|
354
554
|
* `MessageBubble`, `TypingIndicator`, `MentionInput`, `MemberList`.
|
|
@@ -400,7 +600,7 @@ interface ConversationViewProps {
|
|
|
400
600
|
* to render every bubble as standalone (uniform tails).
|
|
401
601
|
*/
|
|
402
602
|
grouping?: boolean;
|
|
403
|
-
/**
|
|
603
|
+
/** @deprecated Use `groupWindowMinutes`. */
|
|
404
604
|
groupingWindowMs?: number;
|
|
405
605
|
/**
|
|
406
606
|
* Insert a centered day-separator pill between messages whose
|
|
@@ -423,12 +623,35 @@ interface ConversationViewProps {
|
|
|
423
623
|
*/
|
|
424
624
|
avatars?: 'auto' | 'always' | 'never';
|
|
425
625
|
/**
|
|
426
|
-
* Fired
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
626
|
+
* Fired after the view marks the latest message read and the server
|
|
627
|
+
* accepts it. Every `useConversations()` / `<ConversationList>` under
|
|
628
|
+
* the same provider has already cleared this conversation's badge by
|
|
629
|
+
* then; use this for anything else (an app-level badge, say).
|
|
630
|
+
* Receives the conv id so a single handler can switch between rooms.
|
|
430
631
|
*/
|
|
431
632
|
onMarkedRead?: (conversationId: string) => void;
|
|
633
|
+
/**
|
|
634
|
+
* Jump to this message: older pages load until it's there, then it
|
|
635
|
+
* scrolls into view and flashes. Set it again (or to another id) to
|
|
636
|
+
* jump again. When it can't be found — deleted, a thread reply, or
|
|
637
|
+
* not in this conversation — a short notice shows and
|
|
638
|
+
* `onFocusMessageNotFound` fires.
|
|
639
|
+
*/
|
|
640
|
+
focusMessageId?: Uuid | null;
|
|
641
|
+
/** `focusMessageId` couldn't be found in this conversation. */
|
|
642
|
+
onFocusMessageNotFound?: (messageId: Uuid) => void;
|
|
643
|
+
/** Makes the sender label on other people's messages a button. */
|
|
644
|
+
onSenderPress?: (user: MessageUser) => void;
|
|
645
|
+
/** Makes the avatar next to other people's messages a button. */
|
|
646
|
+
onAvatarPress?: (user: MessageUser) => void;
|
|
647
|
+
/**
|
|
648
|
+
* `false` hides the composer (and with it quote-reply and dropping
|
|
649
|
+
* files) — for an archived conversation or a viewer who can't post.
|
|
650
|
+
* Defaults to `true`.
|
|
651
|
+
*/
|
|
652
|
+
composer?: boolean;
|
|
653
|
+
/** Same as `composer={false}`. */
|
|
654
|
+
readOnly?: boolean;
|
|
432
655
|
/**
|
|
433
656
|
* Offer "Call back" on call-log rows the viewer missed or declined,
|
|
434
657
|
* or placed with no answer. Receives the call's media; place the call
|
|
@@ -444,7 +667,7 @@ interface ConversationViewProps {
|
|
|
444
667
|
/** The call this client is already on, if any — its banner is hidden. */
|
|
445
668
|
currentCallId?: string | null;
|
|
446
669
|
}
|
|
447
|
-
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, grouping, groupingWindowMs, daySeparators, senderLabels, avatars, onMarkedRead, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
670
|
+
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, grouping, groupingWindowMs, groupWindowMinutes, layout, density, showAvatars, timeFormat, slots, daySeparators, senderLabels, avatars, onMarkedRead, focusMessageId, onFocusMessageNotFound, onSenderPress, onAvatarPress, composer, readOnly, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
448
671
|
|
|
449
672
|
interface ChatHeaderProps {
|
|
450
673
|
/** Conversation id — used to fetch the row + members for the title / presence dot. */
|
|
@@ -547,89 +770,6 @@ interface GroupDetailsSheetProps {
|
|
|
547
770
|
}
|
|
548
771
|
declare function GroupDetailsSheet({ visible, onClose, conversationId, labelFor, avatarFor, footer, }: GroupDetailsSheetProps): react_jsx_runtime.JSX.Element | null;
|
|
549
772
|
|
|
550
|
-
/**
|
|
551
|
-
* Position of this bubble within a same-sender, same-day, ≤5-min
|
|
552
|
-
* cluster. Drives the tail-corner rendering: only `last` and
|
|
553
|
-
* `standalone` get the asymmetric tail, matching the WhatsApp /
|
|
554
|
-
* iMessage convention where consecutive bursts read as a single
|
|
555
|
-
* unit with one trailing tail.
|
|
556
|
-
*/
|
|
557
|
-
type BubbleGroupPosition = 'first' | 'middle' | 'last' | 'standalone';
|
|
558
|
-
interface MessageBubbleProps {
|
|
559
|
-
message: Message;
|
|
560
|
-
/** Used to decide left/right alignment + color, and whether to show the read-receipt glyph. */
|
|
561
|
-
currentUserId: string | null;
|
|
562
|
-
/**
|
|
563
|
-
* Show the read-receipt check-double on self-sent messages. Pass
|
|
564
|
-
* `true` when at least one other member's `last_read_message_id`
|
|
565
|
-
* is >= this message's sequence. Single-tick + double-tick variants
|
|
566
|
-
* map to "sent" and "read" respectively per brand conventions.
|
|
567
|
-
*/
|
|
568
|
-
readState?: 'sent' | 'read';
|
|
569
|
-
/**
|
|
570
|
-
* Optional friendly label for a quoted message's sender. Same shape
|
|
571
|
-
* as `<MemberList labelFor>` — `(externalId) => string` looking up a
|
|
572
|
-
* display name from the local member roster.
|
|
573
|
-
*/
|
|
574
|
-
labelFor?: (externalId: string) => string;
|
|
575
|
-
/**
|
|
576
|
-
* Called when the user clicks the quoted card. Typically used to
|
|
577
|
-
* scroll the chat to the original message + flash a highlight.
|
|
578
|
-
* No-op when omitted.
|
|
579
|
-
*/
|
|
580
|
-
onQuotedClick?: (quotedMessageId: Uuid) => void;
|
|
581
|
-
/**
|
|
582
|
-
* Where this bubble sits within a same-sender cluster (see
|
|
583
|
-
* BubbleGroupPosition). Defaults to `standalone`.
|
|
584
|
-
*/
|
|
585
|
-
groupPosition?: BubbleGroupPosition;
|
|
586
|
-
/**
|
|
587
|
-
* When > 0, truncates the body at this many characters and shows a
|
|
588
|
-
* "Read more" toggle to expand. Defaults to 0 (no truncation).
|
|
589
|
-
*/
|
|
590
|
-
maxBodyLength?: number;
|
|
591
|
-
/**
|
|
592
|
-
* Render the body as GitHub-flavored Markdown (bold, italic, lists,
|
|
593
|
-
* fenced code, blockquotes, strikethrough, autolinks). Defaults to
|
|
594
|
-
* `false`. `<ConversationView>` flips this on by default.
|
|
595
|
-
*/
|
|
596
|
-
markdown?: boolean;
|
|
597
|
-
/**
|
|
598
|
-
* Show a colored sender label above the body for other-side
|
|
599
|
-
* bubbles. Only meaningful in group chats (3+ participants) and
|
|
600
|
-
* only on the FIRST / STANDALONE bubble of a cluster (continuation
|
|
601
|
-
* bubbles share the cluster's identity). The label name comes
|
|
602
|
-
* from the SDK's `useUser` hook via the customer's
|
|
603
|
-
* `userResolver` config.
|
|
604
|
-
*/
|
|
605
|
-
showSenderName?: boolean;
|
|
606
|
-
/**
|
|
607
|
-
* Slot for a "show actions" affordance — typically a chevron
|
|
608
|
-
* rendered by `<MessageRow>` that toggles the actions popover on
|
|
609
|
-
* desktop click. Positioned absolutely at the top-trailing corner
|
|
610
|
-
* inside the bubble so it overlays the message border; hidden by
|
|
611
|
-
* CSS until the row is hovered.
|
|
612
|
-
*/
|
|
613
|
-
actionsTrigger?: ReactNode;
|
|
614
|
-
/**
|
|
615
|
-
* Render the message's attachments INSIDE the bubble (WhatsApp-
|
|
616
|
-
* style): images mosaic at the top, file cards below, then the
|
|
617
|
-
* message body. Defaults to `true`. Pass `false` if you're rendering
|
|
618
|
-
* attachments yourself outside the bubble.
|
|
619
|
-
*/
|
|
620
|
-
showAttachments?: boolean;
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* One message bubble. The default renderer for `<ConversationView>` —
|
|
624
|
-
* customers swap it out via `renderMessage` for full visual control
|
|
625
|
-
* without rebuilding the rest of the chat.
|
|
626
|
-
*
|
|
627
|
-
* Styling: 16px radius bubble with a 5px tail on the sender's side
|
|
628
|
-
* (coral for self, surface-with-border for others), matching the
|
|
629
|
-
* brand-kit chat showcase.
|
|
630
|
-
*/
|
|
631
|
-
declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, markdown, showSenderName, actionsTrigger, showAttachments, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
632
|
-
|
|
633
773
|
interface CallLogRowProps {
|
|
634
774
|
/** The call-log message. Rows that aren't call logs render nothing. */
|
|
635
775
|
msg: Pick<Message, 'type' | 'body' | 'inserted_at'> & {
|
|
@@ -768,10 +908,16 @@ interface MessageActionsProps {
|
|
|
768
908
|
onEdit?: () => void;
|
|
769
909
|
/** Triggered when the user wants to delete. Only show on own messages. */
|
|
770
910
|
onDelete?: () => void;
|
|
911
|
+
/**
|
|
912
|
+
* Slack-style toolbar: React, Reply, Thread, then a "More" button
|
|
913
|
+
* whose menu holds Copy / Edit / Delete. Defaults to `false` (every
|
|
914
|
+
* action as its own button).
|
|
915
|
+
*/
|
|
916
|
+
moreMenu?: boolean;
|
|
771
917
|
/** Render any extra trailing action buttons (e.g. "Pin"). */
|
|
772
918
|
children?: ReactNode;
|
|
773
919
|
}
|
|
774
|
-
declare function MessageActions({ onReact, onReply, onQuote, onCopy, onEdit, onDelete, children, }: MessageActionsProps): react_jsx_runtime.JSX.Element;
|
|
920
|
+
declare function MessageActions({ onReact, onReply, onQuote, onCopy, onEdit, onDelete, moreMenu, children, }: MessageActionsProps): react_jsx_runtime.JSX.Element;
|
|
775
921
|
|
|
776
922
|
interface TypingIndicatorProps {
|
|
777
923
|
/** Set of `external_id`s currently typing — what `useTyping` returns. */
|
|
@@ -804,8 +950,11 @@ interface ThreadViewProps {
|
|
|
804
950
|
* brand-styled <MessageBubble>.
|
|
805
951
|
*/
|
|
806
952
|
renderMessage?: (msg: Message, currentUserId: string | null) => ReactNode;
|
|
953
|
+
/** Row layout for the replies — see `ChatLayout`. Defaults to `'bubbles'`. */
|
|
954
|
+
layout?: ChatLayout;
|
|
955
|
+
timeFormat?: TimeFormat;
|
|
807
956
|
}
|
|
808
|
-
declare function ThreadView({ conversationId, rootMessage, onClose, renderMessage, }: ThreadViewProps): react_jsx_runtime.JSX.Element;
|
|
957
|
+
declare function ThreadView({ conversationId, rootMessage, onClose, renderMessage, layout, timeFormat, }: ThreadViewProps): react_jsx_runtime.JSX.Element;
|
|
809
958
|
|
|
810
959
|
interface AvatarProps {
|
|
811
960
|
/** URL to a profile image. Renders initials fallback when omitted or load fails. */
|
|
@@ -1007,6 +1156,34 @@ interface MentionInputProps {
|
|
|
1007
1156
|
}
|
|
1008
1157
|
declare const MentionInput: react.ForwardRefExoticComponent<MentionInputProps & react.RefAttributes<MessageComposerHandle>>;
|
|
1009
1158
|
|
|
1159
|
+
interface PoolseThemeProps {
|
|
1160
|
+
/**
|
|
1161
|
+
* A built-in theme's id (`'coral'`, `'ocean'`, `'forest'`, `'grape'`,
|
|
1162
|
+
* `'slate'`, `'sunset'`, `'rose'`, `'mono'`) or a whole `Theme` from
|
|
1163
|
+
* `@poolse/theme` (`createTheme`, `decodeTheme`). Omit it to keep
|
|
1164
|
+
* the stylesheet's own colours.
|
|
1165
|
+
*/
|
|
1166
|
+
theme?: ThemeInput;
|
|
1167
|
+
/** `'system'` (default) follows the OS and updates when it changes. */
|
|
1168
|
+
colorScheme?: ColorSchemePreference;
|
|
1169
|
+
className?: string;
|
|
1170
|
+
style?: CSSProperties;
|
|
1171
|
+
children?: ReactNode;
|
|
1172
|
+
}
|
|
1173
|
+
interface PoolseThemeValue {
|
|
1174
|
+
/** The applied theme for the active scheme, or `null` when no `theme` was given. */
|
|
1175
|
+
theme: ResolvedTheme | null;
|
|
1176
|
+
colorScheme: ColorScheme;
|
|
1177
|
+
}
|
|
1178
|
+
/** The OS colour scheme, kept current. `'light'` during server rendering. */
|
|
1179
|
+
declare function useSystemColorScheme(): ColorScheme;
|
|
1180
|
+
declare function PoolseTheme({ theme, colorScheme, className, style, children, }: PoolseThemeProps): react_jsx_runtime.JSX.Element;
|
|
1181
|
+
/**
|
|
1182
|
+
* The nearest `<PoolseTheme>`'s theme and scheme. Outside one, `theme`
|
|
1183
|
+
* is `null` and the scheme is the OS's.
|
|
1184
|
+
*/
|
|
1185
|
+
declare function useTheme(): PoolseThemeValue;
|
|
1186
|
+
|
|
1010
1187
|
type PoolseLogoVariant = 'lockup' | 'mark' | 'wordmark' | 'mono';
|
|
1011
1188
|
interface PoolseLogoProps extends Omit<SVGProps<SVGSVGElement>, 'children'> {
|
|
1012
1189
|
variant?: PoolseLogoVariant;
|
|
@@ -1029,4 +1206,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
|
|
|
1029
1206
|
*/
|
|
1030
1207
|
declare function PoolseFonts(): null;
|
|
1031
1208
|
|
|
1032
|
-
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallControlButton, type CallControlButtonProps, CallDeviceMenu, type CallDeviceMenuProps, CallLogRow, type CallLogRowProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, type InboxUser, LiveCallBanner, type LiveCallBannerProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, RoomJoinBar, type RoomJoinBarProps, RoomStage, type RoomStageProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, UserPickerSheet, type UserPickerSheetProps, useDisplayName, usePoolseFonts };
|
|
1209
|
+
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallControlButton, type CallControlButtonProps, CallDeviceMenu, type CallDeviceMenuProps, CallLogRow, type CallLogRowProps, CallVideoGrid, type CallVideoGridProps, type ChatDensity, ChatHeader, type ChatHeaderProps, type ChatLayout, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, type InboxUser, LiveCallBanner, type LiveCallBannerProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, type MessageSlot, type MessageSlotProps, type MessageSlots, type MessageUser, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, PoolseTheme, type PoolseThemeProps, type PoolseThemeValue, ReactionPicker, ReactionStrip, type ReactionStripProps, type RenderMessageContext, RoomJoinBar, type RoomJoinBarProps, RoomStage, type RoomStageProps, ThreadView, type ThreadViewProps, type TimeFormat, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, UserPickerSheet, type UserPickerSheetProps, useDisplayName, usePoolseFonts, useSystemColorScheme, useTheme };
|