@poolse/react-ui 3.6.0 → 3.6.2

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.d.cts CHANGED
@@ -4,7 +4,7 @@ import * as react from 'react';
4
4
  import { SVGProps, ReactElement, ReactNode, CSSProperties } from 'react';
5
5
  import { GroupPosition, UseRoom, UploadItem, ReactionMap } from '@poolse/react';
6
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';
7
+ export { BUILT_IN_THEME_IDS, BuiltInThemeId, ColorScheme, ColorSchemePreference, DEFAULT_THEME_ID, FlatThemeTokens, Theme, ThemeInput, createTheme, decodeTheme, encodeTheme, tokensFromFlat } from '@poolse/theme';
8
8
 
9
9
  interface CallVideoGridProps {
10
10
  participants: CallParticipant[];
@@ -1061,12 +1061,23 @@ interface ThreadViewProps {
1061
1061
  /** Row layout for the replies — see `ChatLayout`. Defaults to `'bubbles'`. */
1062
1062
  layout?: ChatLayout;
1063
1063
  timeFormat?: TimeFormat;
1064
+ /**
1065
+ * Row spacing. Inside `ConversationView` the thread follows the view's
1066
+ * own `density`; set it when using ThreadView on its own.
1067
+ */
1068
+ density?: ChatDensity;
1069
+ /** Avatars on replies, as `ConversationView`'s `showAvatars`. */
1070
+ showAvatars?: boolean;
1071
+ /** Presence badges on reply avatars. Defaults to `false`. */
1072
+ showPresence?: boolean;
1073
+ /** Link previews under replies. Defaults to `true`. */
1074
+ linkPreviews?: boolean;
1064
1075
  /** Largest attachment accepted, in bytes (see `MessageComposer`). */
1065
1076
  maxFileSize?: number;
1066
1077
  /** Accepted attachment types (see `MessageComposer`). */
1067
1078
  acceptFileTypes?: string[];
1068
1079
  }
1069
- declare function ThreadView({ conversationId, rootMessage, onClose, renderMessage, layout, timeFormat, maxFileSize, acceptFileTypes, }: ThreadViewProps): react_jsx_runtime.JSX.Element;
1080
+ declare function ThreadView({ conversationId, rootMessage, onClose, renderMessage, layout, timeFormat, density, showAvatars, showPresence, linkPreviews, maxFileSize, acceptFileTypes, }: ThreadViewProps): react_jsx_runtime.JSX.Element;
1070
1081
 
1071
1082
  interface ThreadSummaryProps {
1072
1083
  /** The thread's root message. Renders nothing without replies. */
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as react from 'react';
4
4
  import { SVGProps, ReactElement, ReactNode, CSSProperties } from 'react';
5
5
  import { GroupPosition, UseRoom, UploadItem, ReactionMap } from '@poolse/react';
6
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';
7
+ export { BUILT_IN_THEME_IDS, BuiltInThemeId, ColorScheme, ColorSchemePreference, DEFAULT_THEME_ID, FlatThemeTokens, Theme, ThemeInput, createTheme, decodeTheme, encodeTheme, tokensFromFlat } from '@poolse/theme';
8
8
 
9
9
  interface CallVideoGridProps {
10
10
  participants: CallParticipant[];
@@ -1061,12 +1061,23 @@ interface ThreadViewProps {
1061
1061
  /** Row layout for the replies — see `ChatLayout`. Defaults to `'bubbles'`. */
1062
1062
  layout?: ChatLayout;
1063
1063
  timeFormat?: TimeFormat;
1064
+ /**
1065
+ * Row spacing. Inside `ConversationView` the thread follows the view's
1066
+ * own `density`; set it when using ThreadView on its own.
1067
+ */
1068
+ density?: ChatDensity;
1069
+ /** Avatars on replies, as `ConversationView`'s `showAvatars`. */
1070
+ showAvatars?: boolean;
1071
+ /** Presence badges on reply avatars. Defaults to `false`. */
1072
+ showPresence?: boolean;
1073
+ /** Link previews under replies. Defaults to `true`. */
1074
+ linkPreviews?: boolean;
1064
1075
  /** Largest attachment accepted, in bytes (see `MessageComposer`). */
1065
1076
  maxFileSize?: number;
1066
1077
  /** Accepted attachment types (see `MessageComposer`). */
1067
1078
  acceptFileTypes?: string[];
1068
1079
  }
1069
- declare function ThreadView({ conversationId, rootMessage, onClose, renderMessage, layout, timeFormat, maxFileSize, acceptFileTypes, }: ThreadViewProps): react_jsx_runtime.JSX.Element;
1080
+ declare function ThreadView({ conversationId, rootMessage, onClose, renderMessage, layout, timeFormat, density, showAvatars, showPresence, linkPreviews, maxFileSize, acceptFileTypes, }: ThreadViewProps): react_jsx_runtime.JSX.Element;
1070
1081
 
1071
1082
  interface ThreadSummaryProps {
1072
1083
  /** The thread's root message. Renders nothing without replies. */
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { usePoolse, useMembers, useUser, useMe, useConversations, useAttachmentU
5
5
  import ReactMarkdown from 'react-markdown';
6
6
  import remarkGfm from 'remark-gfm';
7
7
  import { resolveTheme, tokensToCssVariables } from '@poolse/theme';
8
- export { BUILT_IN_THEME_IDS, DEFAULT_THEME_ID, createTheme, decodeTheme, encodeTheme } from '@poolse/theme';
8
+ export { BUILT_IN_THEME_IDS, DEFAULT_THEME_ID, createTheme, decodeTheme, encodeTheme, tokensFromFlat } from '@poolse/theme';
9
9
 
10
10
  // src/CallVideoGrid.tsx
11
11
 
@@ -2725,7 +2725,8 @@ function QuotedCard({
2725
2725
  labelFor,
2726
2726
  onClick
2727
2727
  }) {
2728
- const senderLabel = quoted.sender_external_id ? labelFor?.(quoted.sender_external_id) ?? quoted.sender_external_id : "Unknown";
2728
+ const { profile: quotedSender } = useUser(quoted.sender_external_id ?? null);
2729
+ const senderLabel = quoted.sender_external_id ? labelFor?.(quoted.sender_external_id) ?? quotedSender?.displayName ?? quoted.sender_external_id : "Unknown";
2729
2730
  const isDeleted = !!quoted.deleted_at;
2730
2731
  const handleClick = onClick ? () => onClick(quoted.id) : void 0;
2731
2732
  return /* @__PURE__ */ jsxs(
@@ -3695,6 +3696,10 @@ function ThreadView({
3695
3696
  renderMessage,
3696
3697
  layout,
3697
3698
  timeFormat,
3699
+ density,
3700
+ showAvatars,
3701
+ showPresence = false,
3702
+ linkPreviews = true,
3698
3703
  maxFileSize,
3699
3704
  acceptFileTypes
3700
3705
  }) {
@@ -3781,14 +3786,17 @@ function ThreadView({
3781
3786
  },
3782
3787
  onDelete: () => void deleteReply(msg.id),
3783
3788
  ...layout ? { layout } : {},
3784
- ...timeFormat ? { timeFormat } : {}
3789
+ ...timeFormat ? { timeFormat } : {},
3790
+ ...showAvatars !== void 0 ? { showAvatar: showAvatars } : {},
3791
+ showPresence,
3792
+ linkPreviews
3785
3793
  }
3786
3794
  );
3787
3795
  const renderOne = renderMessage ? (msg, currentUserId) => renderMessage(msg, currentUserId) : (msg) => renderDefault(msg);
3788
3796
  return /* @__PURE__ */ jsxs(
3789
3797
  "aside",
3790
3798
  {
3791
- className: `poolse-thread${dragActive ? " is-drag-active" : ""}`,
3799
+ className: `poolse-thread${density ? ` poolse-conversation--density-${density}` : ""}${dragActive ? " is-drag-active" : ""}`,
3792
3800
  role: "complementary",
3793
3801
  "aria-label": "Message thread",
3794
3802
  onDragEnter,
@@ -4644,6 +4652,9 @@ function ConversationView({
4644
4652
  onClose: () => setThreadRootId(null),
4645
4653
  layout,
4646
4654
  ...timeFormat ? { timeFormat } : {},
4655
+ showAvatars: showAvatarsResolved,
4656
+ showPresence,
4657
+ linkPreviews,
4647
4658
  ...attachmentRules
4648
4659
  }
4649
4660
  ) })
@@ -4921,8 +4932,9 @@ function DefaultRow({
4921
4932
  }) {
4922
4933
  const isDirect = conv.type === "direct";
4923
4934
  const otherExtId = isDirect && meExternalId ? (conv.member_external_ids ?? []).find((x) => x !== meExternalId) : null;
4924
- const title = isDirect ? otherExtId ? labelFor?.(otherExtId) ?? otherExtId : conv.name ?? "Direct chat" : conv.name ?? "Untitled group";
4925
- const avatarUrl = isDirect ? otherExtId ? avatarFor?.(otherExtId) ?? null : conv.avatar_url ?? null : conv.avatar_url ?? null;
4935
+ const { profile: other } = useUser(isDirect && otherExtId ? otherExtId : null);
4936
+ const title = isDirect ? otherExtId ? labelFor?.(otherExtId) ?? other?.displayName ?? otherExtId : conv.name ?? "Direct chat" : conv.name ?? "Untitled group";
4937
+ const avatarUrl = isDirect ? otherExtId ? avatarFor?.(otherExtId) ?? other?.avatarUrl ?? null : conv.avatar_url ?? null : conv.avatar_url ?? null;
4926
4938
  const time = conv.last_message_at ? formatRelative(conv.last_message_at) : "";
4927
4939
  const hasUnread = unread > 0;
4928
4940
  const preview = formatCallLogPreview(conv.last_message_preview, meId) ?? conv.last_message_preview ?? (conv.last_sequence > 0 ? `${conv.last_sequence} message${conv.last_sequence === 1 ? "" : "s"}` : "No messages yet");